Skip to content

Commit 5735d86

Browse files
committed
Don't commit changes if no changes are present
1 parent 787ab0a commit 5735d86

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/release_prepare.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,12 @@ jobs:
119119
# Push the changes
120120
- name: Push the changes
121121
run: |
122-
git commit -m "Adding the new version to the necessary files."
123-
git push origin HEAD:${{ github.ref }}
122+
if git diff --cached --quiet; then
123+
echo "No changes to commit"
124+
else
125+
git commit -m "Adding the new version to the necessary files."
126+
git push origin HEAD:${{ github.ref }}
127+
fi
124128
# Create a PR
125129
- name: Create a pull request
126130
# Only run this part once when the release branch is created

0 commit comments

Comments
 (0)