Skip to content

Run the workflow on pull requests, and only on main for pushes - #28

Merged
marcobambini merged 1 commit into
mainfrom
ci-test-pull-requests
Nov 13, 2026
Merged

marcobambini merged 1 commit into
mainfrom
ci-test-pull-requests

Conversation

@marcobambini

Copy link
Copy Markdown
Member

A pull request has never run this workflow. The only trigger was push, and a push to a fork does not run the base repository's workflow, so every pull request this project has had shows "no checks reported":

#22: no checks reported on the 'keep-stack-check-within-stack' branch
#23: no checks reported on the 'collect-garbage-after-out-of-memory' branch
#24: no checks reported on the 'end-result-sets-on-interrupt' branch

All three were merged without a single job having seen them; the 14 jobs ran on main afterwards. That is how the test #22 added reached review still failing on arm64 Linux — PTHREAD_STACK_MIN is 128 KB there, so the 64 KB thread it asks for cannot be created — which linux-arm64 and linux-musl-arm64 would have caught at once.

What changes

pull_request is now a trigger, so a pull request from a fork runs all 14 jobs.

push is limited to main. Keeping '**' alongside pull_request would run everything twice for a pull request from a branch of this repository, once per event — 28 jobs, including the macOS runners and six notarizations. To run the jobs on a branch of its own, which is useful as a dry run of a fork's pull request before merging it, the workflow_dispatch that is already here does it:

gh workflow run main.yml --ref <branch>

The signing steps are skipped where there is nothing to sign with. A pull request from a fork gets no secrets, so without this the six macOS, iOS and xcframework jobs would fail on every outside contribution, at security import or at notarytool submit. They now run the build and the tests and skip signing, which is what the pull request is for. Those artifacts are unsigned, and release runs only for main (if: github.ref == 'refs/heads/main'), so an unsigned artifact is never released. A secret can be read in a job's env but not in a step's if, hence SIGNING as an env entry rather than a condition on secrets directly.

How it was checked

This branch cannot run its own new trigger: GitHub reads the workflow of the base branch for a pull_request event, and main has no such trigger yet. So this pull request shows no checks either — the last one that will.

Checked instead by:

  • pushing the branch, which started nothing, confirming push is limited to main;
  • a workflow_dispatch run on the branch, which uses this file and runs all 14 jobs: run 43424592133;
  • parsing the file to confirm the triggers, the 14 matrix entries, the four guarded steps and the release condition.

Worth doing right after merging: open a throwaway pull request from a branch here and check that exactly one run appears, from the pull_request event and not two.

🤖 Generated with Claude Code

A pull request never ran this workflow: the only trigger was a push, and a
push to a fork does not run the workflow of the base repository. Pull
requests #22, #23 and #24 all show "no checks reported" and were merged
without a single job having seen them; the jobs ran on main afterwards.
That is how the test that #22 added reached main-adjacent review still
failing on arm64 Linux, which linux-arm64 and linux-musl-arm64 would have
caught at once.

Pushes are now limited to main, since a pull request from a branch of this
repository would otherwise run all 14 jobs twice, once for the push and once
for the pull request. To run the jobs on a branch of its own, as a dry run
of a fork's pull request for instance, use the workflow_dispatch that is
already here: gh workflow run main.yml --ref <branch>.

The signing steps are skipped where there are no secrets to sign with, which
is every pull request from a fork: the build and the tests still run, which
is what the pull request is for, and without this the six macOS, iOS and
xcframework jobs would fail on every outside contribution. Their artifacts
are then unsigned, and the release job runs only for main, so an unsigned
artifact is never released. A secret can be read in a job's env but not in a
step's if, which is why SIGNING is an env entry.

This takes effect for pull requests opened after it is merged: GitHub reads
the workflow of the base branch for a pull_request event, so this branch
cannot run its own new trigger. It was checked with a workflow_dispatch run
on the branch instead.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@marcobambini
marcobambini merged commit 254c544 into main Nov 13, 2026
29 checks passed
@marcobambini
marcobambini deleted the ci-test-pull-requests branch November 13, 2026 12:26
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