From f194d56a072cbef8bb5c9317f9e416116b6dc06a Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 10 Aug 2024 16:40:20 +0930 Subject: [PATCH 1/3] fix(badge): Dont attempt to commit if there are no changes fixes #3 https://github.com/nofusscomputing/centurion_erp/pull/209 https://github.com/nofusscomputing/centurion_erp/pull/214 --- .github/workflows/python.yaml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 45ee8de..35f0bc8 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -318,6 +318,7 @@ jobs: - name: Git add + id: git-add shell: bash run: | echo "[Debug] PWD[${PWD}]"; @@ -330,9 +331,28 @@ jobs: echo "[Debug] ****************************"; git status; echo "[Debug] ****************************"; + + if [ "$(git status -s)" ]; + + echo "changed=true" > $GITHUB_OUTPUT; + + echo "[Info] Changes need to be committed"; + + else + + echo "changed=false" > $GITHUB_OUTPUT; + + echo "[Info] NO changes to be committed"; + + fi + + echo "[Debug] ****************************"; + git add . + - name: Git commit + if: ${{ steps.git-add.outputs.changed }} shell: bash run: | echo "[Debug] PWD[${PWD}]"; @@ -347,6 +367,7 @@ jobs: - name: git push + if: ${{ steps.git-add.outputs.changed }} shell: bash run: | echo "[Debug] PWD[${PWD}]"; From dd3a8c29322bbfc6f7147299c01dfa131bf1897a Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 10 Aug 2024 16:42:36 +0930 Subject: [PATCH 2/3] feat(badge): add number of failed tests to badge https://github.com/nofusscomputing/centurion_erp/pull/209 https://github.com/nofusscomputing/centurion_erp/pull/214 --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 35f0bc8..f3e08cb 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -118,7 +118,7 @@ jobs: { "schemaVersion": 1, "label": "Unit Test", - "message": "${{ steps.test-report.outputs.passed }} passed | ${{ steps.test-report.outputs.skipped }} skipped", + "message": "${{ steps.test-report.outputs.passed }} passed | ${{ steps.test-report.outputs.skipped }} skipped | ${{ steps.test-report.outputs.failed }} failed", "logoSvg": "python-logo", "color": "#4584b6", "style": "plastic" From 5dea0502bdf99837a5a1af16962b028aa6cb12dd Mon Sep 17 00:00:00 2001 From: Jon Date: Sat, 10 Aug 2024 16:44:57 +0930 Subject: [PATCH 3/3] ci(pr): add pull request workflow closes #4 --- .github/workflows/pull_request.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/pull_request.yaml diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml new file mode 100644 index 0000000..dd7861b --- /dev/null +++ b/.github/workflows/pull_request.yaml @@ -0,0 +1,15 @@ + +--- + +name: Pull Requests + + +on: + pull_request: {} + + +jobs: + + pull-requests: + name: Pull Request + uses: nofusscomputing/action_pull_requests/.github/workflows/pull-requests.yaml@development