Skip to content

Commit

Permalink
chore: bypass commit if no difference
Browse files Browse the repository at this point in the history
  • Loading branch information
hlf20010508 authored Jan 19, 2024
1 parent 8e5b084 commit 3867e9e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ jobs:
git config --global user.name $NAME
git config --global user.email $EMAIL
git add -A
git commit -m "chore: update version to $RELEASE_VERSION"
git tag -f $RELEASE_VERSION
git push origin HEAD:master
git push origin HEAD:master --tags -f
if git diff-index --quiet HEAD --; then
echo "Bypass commit."
else
git commit -m "chore: update version to $RELEASE_VERSION"
git tag -f $RELEASE_VERSION
git push origin HEAD:master
git push origin HEAD:master --tags -f
fi
if: github.event_name == 'release' && github.event.action == 'published'

- name: Set up QEMU
Expand Down Expand Up @@ -82,4 +86,4 @@ jobs:

- name: Send Notification
run: |
curl -X POST -d "title=Github Actions Notification&body=$GITHUB_REPOSITORY@$TAG_NAME build completed." ${{ secrets.WEBHOOK_URL }}
curl -X POST -d "title=Github Actions Notification&body=$GITHUB_REPOSITORY@$TAG_NAME build completed." ${{ secrets.WEBHOOK_URL }}

0 comments on commit 3867e9e

Please sign in to comment.