diff --git a/.github/workflows/PrepareNextIteration.yml b/.github/workflows/PrepareNextIteration.yml index 31cf588929..7261459283 100644 --- a/.github/workflows/PrepareNextIteration.yml +++ b/.github/workflows/PrepareNextIteration.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: inputs: nextVersion: - description: Version number of the next iteration + description: Version number of the next iteration (e.g. 8.4-SNAPSHOT) required: true jobs: @@ -15,20 +15,36 @@ jobs: pull-requests: write contents: write + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NEXT_VERSION: ${{ inputs.nextVersion }} + steps: - name: Checkout Sources uses: actions/checkout@v4 - name: Update Version Number - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - NEXT_VERSION: ${{ inputs.nextVersion }} run: | git config user.name "${GITHUB_ACTOR}" git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - git checkout -b gh-action/next-iteration + 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="${NEXT_VERSION}" git commit -m 'Prepare next development iteration' -a - git push --set-upstream origin gh-action/next-iteration - gh pr create -B master --title 'Prepare next development iteration' --body '' + git push --set-upstream origin "${BRANCH}" + echo "branch=${BRANCH}" >> $GITHUB_OUTPUT + + - name: Create Pull Request + id: create-pr + run: | + URL=$(gh pr create --draft --base master --title "Prepare next development iteration ${NEXT_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 "Tip: close and reopen the PR to trigger CI. " >> $GITHUB_STEP_SUMMARY