44 workflow_dispatch :
55 inputs :
66 nextVersion :
7- description : Version number of the next iteration
7+ description : Version number of the next iteration (e.g. 8.4-SNAPSHOT)
88 required : true
99
1010jobs :
@@ -15,20 +15,37 @@ jobs:
1515 pull-requests : write
1616 contents : write
1717
18+ env :
19+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
20+ NEXT_VERSION : ${{ inputs.nextVersion }}
21+
1822 steps :
1923
2024 - name : Checkout Sources
2125 uses : actions/checkout@v4
2226
2327 - name : Update Version Number
24- env :
25- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
26- NEXT_VERSION : ${{ inputs.nextVersion }}
28+ id : update-version
2729 run : |
2830 git config user.name "${GITHUB_ACTOR}"
2931 git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
30- git checkout -b gh-action/next-iteration
32+ git config --global core.autocrlf input
33+ git config --global core.safecrlf true
34+ BRANCH="gh-action/next-iteration.${{ github.run_id }}"
35+ git checkout -b "${BRANCH}"
3136 mvn versions:set -DgenerateBackupPoms=false -DnewVersion="${NEXT_VERSION}"
3237 git commit -m 'Prepare next development iteration' -a
33- git push --set-upstream origin gh-action/next-iteration
34- gh pr create -B master --title 'Prepare next development iteration' --body ''
38+ git push --set-upstream origin "${BRANCH}"
39+ echo "branch=${BRANCH}" >> $GITHUB_OUTPUT
40+
41+ - name : Create Pull Request
42+ id : create-pr
43+ run : |
44+ URL=$(gh pr create --draft --base master --title "Prepare next development iteration ${NEXT_VERSION}" --body '')
45+ echo "url=${URL}" >> $GITHUB_OUTPUT
46+
47+ - name : Summary
48+ run : |
49+ echo "Generated ${{steps.create-pr.outputs.url}}." >> $GITHUB_STEP_SUMMARY
50+ echo "New version set to ${NEXT_VERSION}." >> $GITHUB_STEP_SUMMARY
51+ echo "Tip: close and reopen the PR to trigger CI. " >> $GITHUB_STEP_SUMMARY
0 commit comments