From 0a63594654bbb947af234ae63f7ea4236266c279 Mon Sep 17 00:00:00 2001 From: Tomasz Tylenda Date: Tue, 3 Mar 2026 13:46:18 +0100 Subject: [PATCH 1/2] Fix version bump to support X.Y version format by normalizing to X.Y.Z Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/PrepareNextIteration.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/PrepareNextIteration.yml b/.github/workflows/PrepareNextIteration.yml index f07996702a3..4de1656a9f9 100644 --- a/.github/workflows/PrepareNextIteration.yml +++ b/.github/workflows/PrepareNextIteration.yml @@ -22,13 +22,23 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NEXT_VERSION: "${{ inputs.version }}-SNAPSHOT" steps: - name: Checkout Sources uses: actions/checkout@v4 + - name: Normalize Version + id: version + env: + VERSION: ${{ inputs.version }} + run: | + if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+$ ]]; then + VERSION="${VERSION}.0" + fi + echo "full-version=${VERSION}-SNAPSHOT" >> $GITHUB_OUTPUT + + - name: Update Version Number run: | git config user.name "${GITHUB_ACTOR}" @@ -37,7 +47,7 @@ jobs: git config --global core.safecrlf true BRANCH="gh-action/next-iteration.${{ github.run_id }}" git checkout -b "${BRANCH}" - mvn versions:set -DgenerateBackupPoms=false -DnewVersion="${NEXT_VERSION}" + mvn versions:set -DgenerateBackupPoms=false -DnewVersion="${{ steps.version.outputs.full-version }}" git commit -m 'Prepare next development iteration' -a git push --set-upstream origin "${BRANCH}" echo "branch=${BRANCH}" >> $GITHUB_OUTPUT @@ -45,11 +55,11 @@ jobs: - name: Create Pull Request id: create-pr run: | - URL=$(gh pr create --draft --base master --title "Prepare next development iteration ${NEXT_VERSION}" --body '') + URL=$(gh pr create --draft --base master --title "Prepare next development iteration ${{ steps.version.outputs.full-version }}" --body '') echo "url=${URL}" >> $GITHUB_OUTPUT - name: Summary run: | echo "Generated ${{steps.create-pr.outputs.url}}." >> $GITHUB_STEP_SUMMARY - echo "New version set to ${NEXT_VERSION}." >> $GITHUB_STEP_SUMMARY + echo "New version set to ${{ steps.version.outputs.full-version }}." >> $GITHUB_STEP_SUMMARY echo "Tip: close and reopen the PR to trigger CI. " >> $GITHUB_STEP_SUMMARY From 6b392b0be4da950a7a358c50e112d7ecc0d7e8f5 Mon Sep 17 00:00:00 2001 From: Tomasz Tylenda Date: Tue, 3 Mar 2026 13:53:00 +0100 Subject: [PATCH 2/2] Use shared PR workflow --- .github/workflows/PrepareNextIteration.yml | 25 ++++++---------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/.github/workflows/PrepareNextIteration.yml b/.github/workflows/PrepareNextIteration.yml index 4de1656a9f9..83c3f142488 100644 --- a/.github/workflows/PrepareNextIteration.yml +++ b/.github/workflows/PrepareNextIteration.yml @@ -20,9 +20,6 @@ jobs: pull-requests: write contents: write - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - name: Checkout Sources @@ -38,28 +35,20 @@ jobs: fi echo "full-version=${VERSION}-SNAPSHOT" >> $GITHUB_OUTPUT - - name: Update Version Number run: | - git config user.name "${GITHUB_ACTOR}" - git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - git config --global core.autocrlf input - git config --global core.safecrlf true - BRANCH="gh-action/next-iteration.${{ github.run_id }}" - git checkout -b "${BRANCH}" mvn versions:set -DgenerateBackupPoms=false -DnewVersion="${{ steps.version.outputs.full-version }}" - git commit -m 'Prepare next development iteration' -a - git push --set-upstream origin "${BRANCH}" - echo "branch=${BRANCH}" >> $GITHUB_OUTPUT - name: Create Pull Request + uses: SonarSource/release-github-actions/create-pull-request@v1 id: create-pr - run: | - URL=$(gh pr create --draft --base master --title "Prepare next development iteration ${{ steps.version.outputs.full-version }}" --body '') - echo "url=${URL}" >> $GITHUB_OUTPUT + with: + commit-message: "Prepare next development iteration ${{ steps.version.outputs.full-version }}" + title: "Prepare next development iteration ${{ steps.version.outputs.full-version }}" + branch: gh-action/next-iteration + branch-suffix: timestamp - name: Summary run: | - echo "Generated ${{steps.create-pr.outputs.url}}." >> $GITHUB_STEP_SUMMARY + echo "Generated ${{steps.create-pr.outputs.pull-request-url}}." >> $GITHUB_STEP_SUMMARY echo "New version set to ${{ steps.version.outputs.full-version }}." >> $GITHUB_STEP_SUMMARY - echo "Tip: close and reopen the PR to trigger CI. " >> $GITHUB_STEP_SUMMARY