From 9fa81ca97c2cd2deae0f3d0bda75b0586b0bfd0d Mon Sep 17 00:00:00 2001 From: Ritchie Date: Mon, 4 May 2026 23:14:38 -0700 Subject: [PATCH 1/2] Add failure notification to Python unit test workflow --- .github/workflows/testsPython.yml | 37 ++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 452f71d..0531670 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -20,6 +20,10 @@ ############################################################################### name: Python Unit Tests +permissions: + contents: read + issues: write + on: workflow_dispatch: # Allows the workflow to be manually triggered from the GitHub Actions tab pull_request: # @@ -68,12 +72,39 @@ jobs: # on the test results. notifications: needs: python-unit-tests + if: ${{ always() }} runs-on: ubuntu-latest steps: - name: Notify on test results + env: + GH_TOKEN: ${{ github.token }} + NOTIFY_USER: ${{ vars.NOTIFY_USER || github.actor }} run: | + echo "## Python Unit Test Result" >> "$GITHUB_STEP_SUMMARY" + echo "" >> "$GITHUB_STEP_SUMMARY" + echo "Result: ${{ needs.python-unit-tests.result }}" >> "$GITHUB_STEP_SUMMARY" + if [ "${{ needs.python-unit-tests.result }}" == "success" ]; then - echo "success notifications go here" + echo "Python unit tests passed. No failure notification needed." + echo "Python unit tests passed. No failure notification needed." >> "$GITHUB_STEP_SUMMARY" else - echo "failure notifications go here" - fi + echo "::error title=Python unit tests failed::The Python unit test job failed. Please inspect the workflow logs." + + cat > issue_body.md <> "$GITHUB_STEP_SUMMARY" + fi \ No newline at end of file From 2b7aa515a996f3b2a3378efe8f8a256a462583f2 Mon Sep 17 00:00:00 2001 From: Ritchie Date: Mon, 4 May 2026 23:22:38 -0700 Subject: [PATCH 2/2] Fix notification issue creation repo target --- .github/workflows/testsPython.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 0531670..ab071a5 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -102,6 +102,7 @@ jobs: EOF gh issue create \ + --repo "${{ github.repository }}" \ --title "Python unit tests failed in workflow run #${{ github.run_number }}" \ --body-file issue_body.md \ --assignee "$NOTIFY_USER"