Skip to content

Commit 748e7d0

Browse files
Update Next Iteration GHA
1 parent 7809702 commit 748e7d0

1 file changed

Lines changed: 24 additions & 7 deletions

File tree

.github/workflows/PrepareNextIteration.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
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

1010
jobs:
@@ -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

Comments
 (0)