Skip to content

Commit

Permalink
Merge pull request #66 from fabianegli/patch-1
Browse files Browse the repository at this point in the history
Allow Action to succeed even if no changes were made
  • Loading branch information
glyn authored Jan 7, 2025
2 parents ec454b7 + 30ee957 commit b7f908e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ jobs:
echo "... done."
git --no-pager diff
git add -A
if [ -z "$(git diff --staged)" ]; then
# To have the action run successfully, if no changes are staged, we
# manually skip the later commits because they fail with exit code 1
# and this would then display as a failure for the Action.
echo "No staged changes to commit. Skipping commit and push."
exit 0
fi
if [ -n "${{ inputs.message }}" ]; then
git commit -m "${{ inputs.message }}"
else
Expand Down

0 comments on commit b7f908e

Please sign in to comment.