Trigger the merge sync from an event that actually reaches this file (dev-branch) - #1172
Merged
Merged
Conversation
The stub added in #1160 never fired. Not once, across four PRs merged into working-1.6 -- it did not even appear in the repository's Actions workflow list. The cause is that `pull_request_target` is read from the repository's DEFAULT branch, `stable`, and not from the pull request's base branch. GitHub documents this plainly ("runs in the context of the default branch of the base repository"), and it is the general rule for most events -- `push` and `create` are the exceptions that resolve per-ref. A copy of the workflow living on working-1.6 and dev-branch is therefore never consulted, however correct its contents. `tests.yml` was the wrong precedent to reason from. It uses `pull_request`, which is evaluated from the head-into-base merge ref, which is why one copy per base branch works there and why it works without a copy on stable. So use `pull_request: types: [closed]`, which is read from the base branch and therefore reaches this file where it already lives. The alternative -- putting the stub on stable -- would work, but only stable's copy would ever execute, so editing this file on working-1.6 would silently do nothing and every future change to the sync behaviour would need a pull request into the release branch. That trade costs fork PRs. `pull_request` withholds secrets from a fork, and the reusable workflow needs FOG_WORKFLOWS_PRIVATE_KEY to mint its App token, so a merged fork PR would fail rather than sync. The added same-repo guard skips those instead, and the daily sweep picks them up -- the same gap, and the same backstop, that direct pushes already rely on. A gap the schedule already covers beats a red X on every external contribution. Everything else is unchanged: still `pull_request`-family rather than `push`, so the bot's own fixup push cannot re-fire it and the 2026-07-28 loop stays closed; still the same branch allowlist keeping rc-*/feature-* on the schedule; still no logic in this repo. The header now records why `pull_request_target` is wrong here, so the next reader does not switch it back on the reasonable-looking grounds that it is the variant which gets fork secrets. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PqufBbuckux8kitJeW3uAK
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes a bug in #1160: the stub never actually fired
Corrects the trigger on
.github/workflows/sync-generated-files.yml. My mistake in #1160, caught by checking whether it had run.What happened
The stub added in #1160 has not run once. Four PRs merged into
working-1.6since it landed (#1162, #1163, #1164, #1165) and it produced no runs — it didn't even appear in the repository's Actions workflow list:working-1.6is currently1.6.0-beta.3572wherefog-version.shsays it should be1.6.0-beta.3588— 16 commits stale, waiting for the daily sweep, which is exactly the gap #1160 was meant to close.Why
pull_request_targetis read from the repository's default branch —stable— not from the PR's base branch. GitHub documents it directly: "runs in the context of the default branch of the base repository." That's the general rule for most events;pushandcreateare the exceptions that resolve per-ref. So a copy living onworking-1.6/dev-branchis never consulted, no matter how correct its contents.I reasoned from
tests.ymlas precedent, which was wrong: that usespull_request, evaluated from the head-into-base merge ref. That's exactly why one copy per base branch works there, and why it works without a copy onstable.The fix
pull_request: types: [closed]— read from the base branch, so it reaches this file where it already lives.The alternative, putting the stub on
stable, does work and gives fuller coverage. It was rejected because onlystable's copy would ever execute: editing this file onworking-1.6would silently do nothing, and every future change to sync behaviour would need a PR into the release branch.What that costs
Fork PRs.
pull_requestwithholds secrets from forks, and the reusable workflow needsFOG_WORKFLOWS_PRIVATE_KEYto mint its App token — so a merged fork PR would fail rather than sync. The added same-repo guard skips those, and the daily sweep picks them up. That's the same gap, and the same backstop, that direct pushes already rely on — and a gap the schedule already covers beats a red X on every external contribution.Unchanged
Still
pull_request-family rather thanpush, so the bot's own fixup push cannot re-fire it and the 2026-07-28 loop stays closed. Still the same branch allowlist keepingrc-*/feature-*on the schedule. Still no logic in this repo.The header now records why
pull_request_targetis wrong here, so nobody switches it back on the reasonable-looking grounds that it's the variant which gets fork secrets.Verification
actionlintclean; trigger and guard confirmed by parsing the file. The real proof is the next merged PR: it should produce aSync generated files and versionrun, and that run's own push should queue no second run.🤖 Generated with Claude Code
https://claude.ai/code/session_01PqufBbuckux8kitJeW3uAK