Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/post-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,26 @@ jobs:
export NEW_VERSION=$(date +%Y%m%d)-$REVISION_ID
echo "Setting version to $NEW_VERSION"
echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV
mvn versions:set -DnewVersion=$NEW_VERSION
mvn versions:set -DnewVersion=$NEW_VERSION -DgenerateBackupPoms=false
mvn versions:commit

- name: Debug Git Changes
run: |
git status
git diff pom.xml

- name: Create new branch and commit changes
run: |
git config user.name "GitHub Actions Bot"
git config user.email "actions@github.com"
git checkout -b update-version-${{ env.NEW_VERSION }}
git add pom.xml
git commit -m "Update project version to ${{ env.NEW_VERSION }}"
if git status --porcelain | grep .; then
git commit -m "Update project version to ${{ env.NEW_VERSION }}"
else
echo "No changes to commit. Exiting."
exit 0
fi

- name: Push changes to new branch
run: |
Expand All @@ -51,4 +61,12 @@ jobs:
title: "Update project version to ${{ env.NEW_VERSION }}"
body: "Automated version update by GitHub Actions."
branch: update-version-${{ env.NEW_VERSION }}
base: main
base: main

- name: Enable Pull Request Automerge
if: steps.cpr.outputs.pull-request-number != ''
uses: peter-evans/enable-pull-request-automerge@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
pull-request-number: ${{ steps.cpr.outputs.pull-request-number }}
merge-method: merge