From 9838673f0374bb135df09add1cc18e14011f1597 Mon Sep 17 00:00:00 2001 From: tomaschor Date: Sun, 1 Mar 2026 18:14:28 +0000 Subject: [PATCH] Post commit status so test appears in PR checks panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds statuses: write permission and two createCommitStatus calls — one to mark the check as pending at the start and one to mark it success/failure at the end. This makes the run show up as a named check at the bottom of the PR with a clickable link to the logs. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/run-tests.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 7096e64..fddd927 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -18,6 +18,7 @@ jobs: contents: read issues: write pull-requests: write + statuses: write steps: - name: React to trigger comment @@ -39,6 +40,20 @@ jobs: SHA=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.issue.number }} --jq '.head.sha') echo "sha=$SHA" >> "$GITHUB_OUTPUT" + - name: Set commit status to pending + uses: actions/github-script@v7 + with: + script: | + github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: '${{ steps.sha.outputs.sha }}', + state: 'pending', + target_url: `${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`, + description: 'Simulation test running…', + context: 'Simulation Tests', + }); + - uses: actions/checkout@v4 with: ref: ${{ steps.sha.outputs.sha }} @@ -87,6 +102,23 @@ jobs: path: anims/ci_test.mp4 if-no-files-found: warn + - name: Update commit status + uses: actions/github-script@v7 + if: always() + with: + script: | + const success = '${{ steps.verify.outcome }}' === 'success'; + const runUrl = `${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}`; + github.rest.repos.createCommitStatus({ + owner: context.repo.owner, + repo: context.repo.repo, + sha: '${{ steps.sha.outputs.sha }}', + state: success ? 'success' : 'failure', + target_url: runUrl, + description: success ? 'Simulation test passed' : 'Simulation test failed', + context: 'Simulation Tests', + }); + - name: Comment result on PR uses: actions/github-script@v7 if: always()