Skip to content

Merge pull request #45 from SelahattinSert/push-docker-image-to-acr #7

Merge pull request #45 from SelahattinSert/push-docker-image-to-acr

Merge pull request #45 from SelahattinSert/push-docker-image-to-acr #7

Workflow file for this run

name: Post-Merge Version Update
on:
push:
branches:
- main
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set Up Java
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'
- name: Set new version
run: |
export REVISION_ID=$(git rev-parse --short HEAD)
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:commit
- name: Commit and push changes
run: |
git config user.name "GitHub Actions Bot"
git config user.email "actions@github.com"
git add pom.xml
git commit -m "Update project version to ${{ env.NEW_VERSION }}"
git pull --rebase
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} HEAD:main