fix: correct the upstream-sync workflows:write mistake — that permission key doesn't exist - #58
Merged
Conversation
…ion key doesn't exist The previous fix (merged as #55) added workflows: write to this file's permissions: block on the mistaken assumption that it's a grantable GITHUB_TOKEN scope, mirroring the wording of the push-rejection error message. It isn't — there is no such permissions key at all, and GitHub's schema validator now rejects this file outright (confirmed via a failed workflow_dispatch: "Unexpected value 'workflows'"), which is strictly worse than the original bug. GITHUB_TOKEN can never push a commit touching .github/workflows/*, full stop — that restriction isn't scoped by permissions: and can't be granted to the default token. mlx-swift's sibling upstream-sync.yml already works around this correctly: restore .github/workflows from origin/main after merging upstream, so the push never actually touches workflow files. This applies the same pattern here.
1 task
solderzzc
added a commit
that referenced
this pull request
Aug 16, 2026
…59) #58's restoration step (git checkout origin/main -- .github/workflows) looked right but was a no-op for exactly the case that matters: a workflow_dispatch run just failed again with the identical integration_tests.yml rejection. git checkout <ref> -- <path> only overwrites paths that already exist in <ref>. It doesn't delete files present in the working tree/index but absent from <ref> — so a brand-new file the merge just pulled in from upstream (origin/main never had it) survives untouched, and the push still gets rejected for it. Verified locally with a throwaway git sandbox reproducing the exact scenario (origin lacks a file, upstream adds it, merge, restore): without rm -rf first, the restore step produces a zero-diff commit and the new file is still there; with it, the file is correctly staged for deletion and the restore actually restores. Co-authored-by: Aegis AI Assistant <simba@aegis-ai.dev>
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.
Summary
Corrects a mistake in #55. That PR added
workflows: writeto this workflow'spermissions:block, on the assumption it was a grantableGITHUB_TOKENscope — it isn't. There is no such permissions key, and GitHub's schema validator now rejects the file outright:This is strictly worse than the original bug (a silently-failing push vs. an invalid workflow file).
Real fix
GITHUB_TOKENcan never push a commit that touches.github/workflows/*— that restriction is hard-coded and isn't scoped bypermissions:. The siblingmlx-swift/upstream-sync.ymlalready works around this correctly (and has succeeded on every run): restore.github/workflowsfromorigin/mainafter merging upstream, so the push never actually contains workflow-file changes. This PR applies the same pattern here.Test plan
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/upstream-sync.yml'))"parses cleanly.workflow_dispatchand confirm it runs (no schema-parse error) and pushes successfully.