File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change 135135 required : false
136136 type : boolean
137137 default : false
138+ bump-version-normalize :
139+ description : " If true, the version will have full major.minor.patch format, otherwise the final .0 is dropped."
140+ required : false
141+ type : boolean
142+ default : false
138143 bump-version-pr-lables :
139144 description : " Labels to apply to the version bump pull request if bump-version is true. For example, 'update-next-dev,skip-qa'."
140145 required : false
@@ -482,10 +487,25 @@ jobs:
482487 contents : write
483488 pull-requests : write
484489 steps :
490+ # Convert the version returned by release-in-jira to the full "major.minor.patch" format
491+ # (it drops the patch if it is 0).
492+ - name : Normalize Version
493+ id : normalize
494+ if : ${{ inputs.bump-version-normalize }}
495+ shell : bash
496+ run : |
497+ INPUT="${{ needs.release-in-jira.outputs.new-version }}"
498+ if [[ $INPUT =~ ^[0-9]+\.[0-9]+$ ]]; then
499+ OUTPUT="${INPUT}.0"
500+ else
501+ OUTPUT="$INPUT"
502+ fi
503+ echo "version=${OUTPUT}" >> "$GITHUB_OUTPUT"
504+
485505 - name : Bump version and create PR
486506 uses : SonarSource/release-github-actions/bump-version@v1
487507 with :
488- version : ${{ needs.release-in-jira.outputs.new-version }}
508+ version : ${{ steps.normalize.outputs.version || needs.release-in-jira.outputs.new-version }}
489509 pr-labels : ${{ inputs.bump-version-pr-lables }}
490510 excluded-modules : ${{ inputs.bump-version-exlusions }}
491511 base-branch : ${{ inputs.branch }}
You can’t perform that action at this time.
0 commit comments