Open webknjaz opened 5 months ago
Hi! You can do something like this currently:
- uses: mtkennerly/dunamai-action@v1
with:
env-var: VERSION_DISTANCE
args: --format "{distance}"
- uses: mtkennerly/dunamai-action@v1
with:
env-var: VERSION_STAGE
args: --format "{stage}"
Then to determine the info you want:
is-untagged-commit
= ${{ env.VERSION_DISTANCE != '0' }}
is-pre-release
= ${{ env.VERSION_STAGE != '' }}
Hi, I'd like to use the action not only to detect a version but use its other properties. In the Python ecosystem, the versions are PEP 440 style. In my workflows, I create GitHub Releases that have a boolean for whether said version is a pre-release. It would be useful to have an output
is-pre-release
that could be used to set this flag. A poor man's check would be to see if a version string contains one of'a'
,'b'
,'c'
or'd'
. However, it seems likedunamai
should already have this information internally, so why not expose it? FWIW, I think I'll use this simple check for now. Another useful bit could be exposing if a version has a PEP 440 local version identifier part. It could be calledis-untagged-commit
. Perhaps, a more generic solution would be exposing the string components asmajor
,minor
,patch
(aliased asmicro
, perhaps) andlocal
.