Skip to content

Commit d34c9fd

Browse files
Use if:
1 parent dd4d8f7 commit d34c9fd

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.github/workflows/automated-release.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -487,16 +487,15 @@ jobs:
487487
contents: write
488488
pull-requests: write
489489
steps:
490-
# If requested, convert the version returned by release-in-jira
491-
# to the full "major.minor.patch" format (it drops the patch if it is 0).
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).
492492
- name: Normalize Version
493493
id: normalize
494+
if: ${{ inputs.bump-version-normalize }}
494495
shell: bash
495-
env:
496-
NORMALIZE: ${{ inputs.bump-version-normalize }}
497-
INPUT: ${{ needs.release-in-jira.outputs.new-version }}
498496
run: |
499-
if [[ $NORMALIZE == 'true' && $INPUT =~ ^[0-9]+\.[0-9]+$ ]]; then
497+
INPUT="${{ needs.release-in-jira.outputs.new-version }}"
498+
if [[ $INPUT =~ ^[0-9]+\.[0-9]+$ ]]; then
500499
OUTPUT="${INPUT}.0"
501500
else
502501
OUTPUT="$INPUT"
@@ -506,7 +505,7 @@ jobs:
506505
- name: Bump version and create PR
507506
uses: SonarSource/release-github-actions/bump-version@v1
508507
with:
509-
version: ${{ steps.normalize.outputs.version }}
508+
version: ${{ steps.normalize.outputs.version || needs.release-in-jira.outputs.new-version }}
510509
pr-labels: ${{ inputs.bump-version-pr-lables }}
511510
excluded-modules: ${{ inputs.bump-version-exlusions }}
512511
base-branch: ${{ inputs.branch }}

0 commit comments

Comments
 (0)