From daad6e430eb85662c4483e45184941448f5394d6 Mon Sep 17 00:00:00 2001 From: Ronald Ho Date: Fri, 15 May 2026 15:54:58 -0700 Subject: [PATCH 1/3] DAP-20 Capstone modification - Notify on failure --- .github/workflows/testsPython.yml | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython.yml index 452f71d..b5e5156 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython.yml @@ -35,6 +35,10 @@ on: env: python-version: "3.13" +permissions: + contents: read + issues: write + jobs: # Job #1: Run Python unit tests # @@ -68,12 +72,24 @@ jobs: # on the test results. notifications: needs: python-unit-tests + if: always() && needs.python-unit-tests.result == 'failure' runs-on: ubuntu-latest steps: - - name: Notify on test results - run: | - if [ "${{ needs.python-unit-tests.result }}" == "success" ]; then - echo "success notifications go here" - else - echo "failure notifications go here" - fi + - name: Create failure notification issue + uses: actions/github-script@v7 + with: + script: | + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: `Python unit tests failed: ${context.workflow}`, + body: [ + 'The Python unit test job failed.', + '', + `Workflow: ${context.workflow}`, + `Run: ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`, + `Commit: ${context.sha}`, + `Triggered by: @${context.actor}` + ].join('\n'), + assignees: [context.actor] + }); From 8f4be2f0b2c4dd95015f44f17999592926a49490 Mon Sep 17 00:00:00 2001 From: Ronald Ho Date: Fri, 15 May 2026 15:58:17 -0700 Subject: [PATCH 2/3] test failure --- .github/actions/tests/python/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/tests/python/action.yml b/.github/actions/tests/python/action.yml index 9e54504..9f661a2 100644 --- a/.github/actions/tests/python/action.yml +++ b/.github/actions/tests/python/action.yml @@ -134,6 +134,7 @@ runs: GITHUB_ACTIONS: "true" DEBUG_MODE: "true" run: | + exit 1 make coverage - name: Upload coverage to Codecov From 564bb001b65a14c6c75564c03909276cbb3dc71f Mon Sep 17 00:00:00 2001 From: Ronald Ho Date: Fri, 15 May 2026 16:01:17 -0700 Subject: [PATCH 3/3] revert test failure --- .github/actions/tests/python/action.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/actions/tests/python/action.yml b/.github/actions/tests/python/action.yml index 9f661a2..9e54504 100644 --- a/.github/actions/tests/python/action.yml +++ b/.github/actions/tests/python/action.yml @@ -134,7 +134,6 @@ runs: GITHUB_ACTIONS: "true" DEBUG_MODE: "true" run: | - exit 1 make coverage - name: Upload coverage to Codecov