Skip to content

Commit e59d080

Browse files
authored
Merge pull request #6 from nofusscomputing/genensis
fix(badge): Dont attempt to commit if there are no changes
2 parents 7bdd98c + 5dea050 commit e59d080

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

.github/workflows/pull_request.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
---
3+
4+
name: Pull Requests
5+
6+
7+
on:
8+
pull_request: {}
9+
10+
11+
jobs:
12+
13+
pull-requests:
14+
name: Pull Request
15+
uses: nofusscomputing/action_pull_requests/.github/workflows/pull-requests.yaml@development

.github/workflows/python.yaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
{
119119
"schemaVersion": 1,
120120
"label": "Unit Test",
121-
"message": "${{ steps.test-report.outputs.passed }} passed | ${{ steps.test-report.outputs.skipped }} skipped",
121+
"message": "${{ steps.test-report.outputs.passed }} passed | ${{ steps.test-report.outputs.skipped }} skipped | ${{ steps.test-report.outputs.failed }} failed",
122122
"logoSvg": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" viewBox=\"0 0 162.53 196.9\"><defs><linearGradient id=\"a\" x1=\"319.46\" y1=\"219.79\" x2=\"478.86\" y2=\"82.65\" gradientTransform=\"matrix(0.56, 0, 0, -0.57, -8.96, 287.06)\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#5a9fd4\"/><stop offset=\"1\" stop-color=\"#306998\"/></linearGradient><linearGradient id=\"b\" x1=\"540.48\" y1=\"-0.35\" x2=\"483.56\" y2=\"80.18\" gradientTransform=\"matrix(0.56, 0, 0, -0.57, -8.96, 287.06)\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#ffd43b\"/><stop offset=\"1\" stop-color=\"#ffe873\"/></linearGradient><radialGradient id=\"c\" cx=\"-809.2\" cy=\"196.83\" r=\"42.46\" gradientTransform=\"matrix(0, -0.24, -1.05, 0, 463.94, 150.1)\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#b8b8b8\" stop-opacity=\"0.5\"/><stop offset=\"1\" stop-color=\"#7f7f7f\" stop-opacity=\"0\"/></radialGradient></defs><title>python-logo</title><path d=\"M255,157.55a111.94,111.94,0,0,0-18.73,1.6c-16.59,2.93-19.6,9.07-19.6,20.38v14.94h39.2v5H202c-11.39,0-21.37,6.85-24.49,19.88-3.6,14.93-3.76,24.25,0,39.84,2.79,11.61,9.44,19.88,20.84,19.88h13.48V261.13c0-12.94,11.2-24.35,24.49-24.35h39.16a19.75,19.75,0,0,0,19.6-19.92V179.53c0-10.62-9-18.61-19.6-20.38A122.28,122.28,0,0,0,255,157.55Zm-21.2,12a7.47,7.47,0,1,1-7.36,7.49A7.44,7.44,0,0,1,233.83,169.57Z\" transform=\"translate(-174.73 -157.55)\" style=\"fill:url(#a)\"/><path d=\"M299.95,199.45v17.41c0,13.5-11.44,24.86-24.49,24.86H236.3c-10.73,0-19.6,9.18-19.6,19.92V299c0,10.62,9.24,16.87,19.6,19.92,12.41,3.65,24.31,4.31,39.16,0,9.87-2.86,19.6-8.61,19.6-19.92V284H255.9v-5h58.76c11.39,0,15.64-7.95,19.6-19.88,4.09-12.28,3.92-24.09,0-39.84-2.82-11.34-8.19-19.88-19.6-19.88Zm-22,94.54a7.47,7.47,0,1,1-7.36,7.45A7.4,7.4,0,0,1,277.92,294Z\" transform=\"translate(-174.73 -157.55)\" style=\"fill:url(#b)\"/><path d=\"M308.88,344.26c0,5.63-23.52,10.19-52.54,10.19s-52.54-4.56-52.54-10.19,23.52-10.19,52.54-10.19S308.88,338.64,308.88,344.26Z\" transform=\"translate(-174.73 -157.55)\" style=\"opacity:0.44382017850875854;isolation:isolate;fill:url(#c)\"/></svg>",
123123
"color": "#4584b6",
124124
"style": "plastic"
@@ -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)