fix(ci): fix upstream-sync workflow failure#80
Merged
Conversation
…tion GITHUB_TOKEN cannot push .github/workflows/ changes regardless of the 'workflows: write' permission declaration — GitHub enforces this because the token is a GitHub App installation token without the 'workflows' scope. The upstream k8snetworkplumbingwg/whereabouts repo periodically modifies its own CI workflows (e.g. image-build.yml), and the sync branch containing those changes is rejected at push time with: 'refusing to allow a GitHub App to create or update workflow without workflows permission' Fix: after the upstream merge (clean or conflicting), restore the fork's own .github/workflows/ directory from origin/main so the sync branch never includes upstream workflow file changes. Also removes the ineffective 'workflows: write' permission which was silently ignored by GitHub. Fixes: upstream-sync run failures since 2026-04-01 Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
There was a problem hiding this comment.
Pull request overview
Fixes the fork’s upstream-sync GitHub Actions workflow so it can successfully push sync branches even when upstream changes .github/workflows/*, which GitHub rejects for GITHUB_TOKEN pushes.
Changes:
- Removes the ineffective
workflows: writepermission from the workflow. - After merging upstream, restores
.github/workflows/fromorigin/main(clean merge and conflict-merge paths) to prevent push rejection. - Updates PR body generation to note when upstream workflow changes were excluded from the sync PR.
…nflict body when only workflow files conflicted
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
The
upstream-syncworkflow has been failing since 2026-04-01 on every scheduled and push-triggered run.Root Cause
The upstream repo (
k8snetworkplumbingwg/whereabouts) periodically modifies its own CI workflow files (e.g..github/workflows/image-build.yml). When the sync workflow merges those changes and tries to push the sync branch, GitHub rejects it:Why
workflows: writein the permissions block didn't help:GITHUB_TOKENis a GitHub App installation token. GitHub does not grantworkflowswrite scope toGITHUB_TOKENregardless of what the workflow declares — this is a platform-level security restriction. The permission was silently ignored.Evidence from run 24300654813 (scheduled, 10s duration):
2 commits aheaddetected ✓.github/workflows/image-build.yml)The 0-second
push-triggered failures (runs 24415883030, 24415865745, etc.) were phantom runs from GitHub's internal workflow-file change tracking — they immediately fail with 0 jobs because they were triggered by a push containing workflow file changes.Fix
After the upstream merge (clean or conflicting), restore the fork's own
.github/workflows/directory fromorigin/mainbefore pushing. This ensures the sync branch never contains upstream workflow changes, avoiding the push rejection.workflows: writepermission declaration is removedTesting
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/upstream-sync.yml'))"✓go build ./...passes ✓.github/workflows/upstream-sync.ymlmodified