From f42fa96a580e5a722e702926995b6496edd3c7c7 Mon Sep 17 00:00:00 2001 From: peter604 <40276771+peter604@users.noreply.github.com> Date: Mon, 4 May 2026 23:35:39 -0700 Subject: [PATCH] ci(notifications): post PR comment with test result MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace placeholder echo stubs with actions/github-script@v7. Calls GitHub REST API to comment on the originating PR with pass/fail status and a direct link to the run for triage. Guard added so job only runs on pull_request events — issue_number is undefined on push triggers. --- ...stsPython.yml => testsPython-peter604.yml} | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) rename .github/workflows/{testsPython.yml => testsPython-peter604.yml} (78%) diff --git a/.github/workflows/testsPython.yml b/.github/workflows/testsPython-peter604.yml similarity index 78% rename from .github/workflows/testsPython.yml rename to .github/workflows/testsPython-peter604.yml index 452f71d..8fd088c 100644 --- a/.github/workflows/testsPython.yml +++ b/.github/workflows/testsPython-peter604.yml @@ -69,11 +69,20 @@ jobs: notifications: needs: python-unit-tests runs-on: ubuntu-latest + if: github.event_name == 'pull_request' 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 + uses: actions/github-script@v7 + with: + script: | + const result = '${{ needs.python-unit-tests.result }}'; + const message = result === 'success' + ? '✅ Python unit tests passed successfully.' + : '❌ Python unit tests failed. Please check the [workflow run](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for details.'; + + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: message, + });