Skip to content

Commit f194d56

Browse files
committed
fix(badge): Dont attempt to commit if there are no changes
fixes #3 nofusscomputing/centurion_erp#209 nofusscomputing/centurion_erp#214
1 parent 7bdd98c commit f194d56

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/python.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ jobs:
318318
319319
320320
- name: Git add
321+
id: git-add
321322
shell: bash
322323
run: |
323324
echo "[Debug] PWD[${PWD}]";
@@ -330,9 +331,28 @@ jobs:
330331
echo "[Debug] ****************************";
331332
git status;
332333
echo "[Debug] ****************************";
334+
335+
if [ "$(git status -s)" ];
336+
337+
echo "changed=true" > $GITHUB_OUTPUT;
338+
339+
echo "[Info] Changes need to be committed";
340+
341+
else
342+
343+
echo "changed=false" > $GITHUB_OUTPUT;
344+
345+
echo "[Info] NO changes to be committed";
346+
347+
fi
348+
349+
echo "[Debug] ****************************";
350+
333351
git add .
334352
353+
335354
- name: Git commit
355+
if: ${{ steps.git-add.outputs.changed }}
336356
shell: bash
337357
run: |
338358
echo "[Debug] PWD[${PWD}]";
@@ -347,6 +367,7 @@ jobs:
347367
348368
349369
- name: git push
370+
if: ${{ steps.git-add.outputs.changed }}
350371
shell: bash
351372
run: |
352373
echo "[Debug] PWD[${PWD}]";

0 commit comments

Comments
 (0)