Skip to content

Commit d6f9383

Browse files
committed
added condition to git commit step
1 parent 68fea0f commit d6f9383

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/generate_api.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ jobs:
6060
run: |
6161
cd current-repo
6262
git add .
63-
git commit -m "Update generated MATLAB API"
64-
git push origin main
63+
# Check if there are any changes to commit
64+
if git diff-index --quiet HEAD --; then
65+
echo "No changes to commit."
66+
else
67+
git commit -m "Update generated MATLAB API"
68+
git push origin main
6569
env:
6670
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)