Skip to content

Commit

Permalink
Add check in case the new version is already pushed and no changes ha…
Browse files Browse the repository at this point in the history
…ve been made
  • Loading branch information
gpmayorga committed Dec 3, 2024
1 parent 20a9c55 commit 839a09a
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,15 @@ jobs:
run: |
VERSION=$(node -p "require('./package.json').version")
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add package.json
git commit -am "chore:Bump version to ${VERSION}"
git push
git config user.email "[email protected]"
# Check if package.json has changes
if git diff --quiet package.json; then
echo "::notice::Version ${VERSION} is already pushed. No changes to commit."
else
git add package.json
git commit -am "chore: Bump version to ${VERSION}"
git push
fi

0 comments on commit 839a09a

Please sign in to comment.