Skip to content

fix: grant workflows:write so upstream-sync can push workflow-file changes - #55

Merged
solderzzc merged 1 commit into
mainfrom
fix/upstream-sync-workflows-permission
Aug 16, 2026
Merged

fix: grant workflows:write so upstream-sync can push workflow-file changes#55
solderzzc merged 1 commit into
mainfrom
fix/upstream-sync-workflows-permission

Conversation

@solderzzc

Copy link
Copy Markdown
Member

Summary

  • upstream-sync.yml has failed on every scheduled run since upstream (ml-explore/mlx-swift-lm) added integration_tests.yml.
  • Root cause: pushing a commit that touches .github/workflows/* requires the workflows: write permission scope, which this workflow didn't grant (only contents: write and pull-requests: write).
  • Failure signature (10/10 recent runs):
    ! [remote rejected] sync/upstream-latest -> sync/upstream-latest (refusing to allow a GitHub App to create or update workflow `.github/workflows/integration_tests.yml` without `workflows` permission)
    

Fix

Add workflows: write to the job's permissions: block. No credential changes needed — the default GITHUB_TOKEN already supports this scope, it just wasn't declared.

Test plan

  • Merge, then trigger workflow_dispatch manually and confirm the sync branch pushes successfully and a PR opens.

…anges

Every scheduled run has failed since upstream added integration_tests.yml:
GitHub blocks GITHUB_TOKEN from pushing any commit touching
.github/workflows/* unless workflows:write is explicitly granted, and this
workflow only had contents:write and pull-requests:write.
@solderzzc
solderzzc merged commit 541f488 into main Aug 16, 2026
6 checks passed
@solderzzc
solderzzc deleted the fix/upstream-sync-workflows-permission branch August 16, 2026 15:25
solderzzc added a commit that referenced this pull request Aug 16, 2026
…ion key doesn't exist (#58)

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.

Co-authored-by: Aegis AI Assistant <simba@aegis-ai.dev>
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