File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -318,6 +318,7 @@ jobs:
318
318
319
319
320
320
- name : Git add
321
+ id : git-add
321
322
shell : bash
322
323
run : |
323
324
echo "[Debug] PWD[${PWD}]";
@@ -330,9 +331,28 @@ jobs:
330
331
echo "[Debug] ****************************";
331
332
git status;
332
333
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
+
333
351
git add .
334
352
353
+
335
354
- name : Git commit
355
+ if : ${{ steps.git-add.outputs.changed }}
336
356
shell : bash
337
357
run : |
338
358
echo "[Debug] PWD[${PWD}]";
@@ -347,6 +367,7 @@ jobs:
347
367
348
368
349
369
- name : git push
370
+ if : ${{ steps.git-add.outputs.changed }}
350
371
shell : bash
351
372
run : |
352
373
echo "[Debug] PWD[${PWD}]";
You can’t perform that action at this time.
0 commit comments