From d94ffc13ca1549bd6fb43f1eb2c4c1ae2e2e37a5 Mon Sep 17 00:00:00 2001 From: fredcallagan Date: Fri, 6 Nov 2026 17:48:26 +0000 Subject: [PATCH] ci: post the full-tests status from the hand run GitHub does not count the jobs of a hand run for a PR. A commit status counts for any PR on that commit. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UYququ3WS39mg9GreQ9iNb --- .github/workflows/arn-code-full-tests.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/arn-code-full-tests.yml b/.github/workflows/arn-code-full-tests.yml index d5f7bbc..ec9e9db 100644 --- a/.github/workflows/arn-code-full-tests.yml +++ b/.github/workflows/arn-code-full-tests.yml @@ -1,8 +1,9 @@ name: arn-code full tests # Run by hand only: gh workflow run arn-code-full-tests.yml --ref -# Branch protection on main requires the "full-tests" check, so a PR cannot merge until this has -# passed on its last commit. A new push needs a new run. Keep this file free of pull_request and +# The ruleset on main requires the "full-tests" status, so a PR cannot merge until this has passed +# on its last commit. A new push needs a new run. The report job posts that status itself, because +# GitHub does not count the jobs of a hand run for a PR. Keep this file free of pull_request and # push triggers: a job skipped by a condition counts as passed for a required check. on: @@ -38,13 +39,22 @@ jobs: - name: Script and hook tests (system bash; 3.2 on macOS; Git Bash on Windows) run: bash tests/arn-code/run-tests.sh - # The one check that branch protection requires: its name does not change with the system list. - full-tests: + # Posts the one status that the ruleset requires: its name does not change with the system list. + report: needs: tests if: always() runs-on: ubuntu-latest + permissions: + statuses: write steps: - - name: All systems passed + - name: Post the full-tests status on the commit env: + GH_TOKEN: ${{ github.token }} RESULT: ${{ needs.tests.result }} - run: test "$RESULT" = success + run: | + state=failure + if [ "$RESULT" = success ]; then state=success; fi + gh api "repos/$GITHUB_REPOSITORY/statuses/$GITHUB_SHA" \ + -f state="$state" -f context=full-tests -f description="All systems: $RESULT" \ + -f target_url="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" + test "$state" = success