Skip to content

ci: report a fixed-name check for branch protection #patch - #10

Merged
nmichlo merged 5 commits into
mainfrom
ci/gate-jobs
Sep 13, 2026
Merged

nmichlo merged 5 commits into
mainfrom
ci/gate-jobs

Conversation

@nmichlo

@nmichlo nmichlo commented Sep 13, 2026

Copy link
Copy Markdown
Owner

Adds one job per workflow whose only purpose is to report a status check with a
fixed name, so branch protection has something stable to require.

Why

Branch protection matches a required status check by name, and every name CI
produces naturally is unstable:

reusable job  ->  "lint / pre-commit"            renaming a job breaks the rule
matrix job    ->  "test (3.12)", "test (3.13)"   changing the matrix breaks it

When the required name stops being reported, the rule waits for a check that
will never arrive and every PR deadlocks. Nothing warns you; the rule just
sits there.

Before -> after

  jobs:
    pre-commit:
      uses: nmichlo/.github/.github/workflows/pre-commit.yaml@main
+
+   lint:
+     needs: [pre-commit]
+     if: always()
+     runs-on: ubuntu-latest
+     steps:
+       - env: {RESULTS: "${{ join(needs.*.result, ' ') }}"}
+         run: |
+           read -r -a outcomes <<< "${RESULTS}"
+           for outcome in "${outcomes[@]}"; do
+             [ "${outcome}" = "success" ] || exit 1
+           done

if: always() is required. Without it the gate is skipped whenever what it
guards fails -- and a skipped required check counts as success.

join(needs.*.result, ' ') collects whatever the job lists in needs, so the
same block is identical in every repo regardless of how many jobs it guards.

Result

Every repo now reports the same two checks, lint and test, whatever it runs
underneath. That is what the rulesets will require.

🤖 Generated with Claude Code

@nmichlo
nmichlo merged commit 77d3d3a into main Sep 13, 2026
5 checks passed
@nmichlo
nmichlo deleted the ci/gate-jobs branch September 13, 2026 17:25

This branch had an error being deployed

1 failed deployment
pypi d203f591 Deployed Sep 13, 2026 by nmichlo via Publish to PyPI #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant