Closed astldev closed 11 months ago
It is not possible at the moment to do this type of formatting in the action. At the moment you can specify a format by setting the version_format
parameter, which defaults to "${major}.${minor}.${patch}-prerelease${increment}"
. Internally this is implemented with a simple string replace.
I've had mixed feelings about this, the format impacts the output only but sometimes people have mistakenly believed it was used to set the input format.
Anyway, all the values are available as outputs, so you can just format this in a subsequent something like this:
...
- name: Format Version
id: format-version
run: echo "::set-output name=version::$MAJOR.$MINOR.$PATCH-$(printf '%03d' $INCREMENT)"
env:
MAJOR: {{ steps.version.outputs.major }}
MINOR: {{ steps.version.outputs.minor }}
PATCH: {{ steps.version.outputs.patch }}
INCREMENT: {{ steps.version.outputs.increment }}
How can I zero-pad the increment?