Skip to content

fix: pin gh repo targeting in fork-sync - #6

Merged
sc0rp10 merged 1 commit into
mainfrom
fix/fork-sync-gh-repo-targeting
Sep 14, 2026
Merged

sc0rp10 merged 1 commit into
mainfrom
fix/fork-sync-gh-repo-targeting

Conversation

@sc0rp10

@sc0rp10 sc0rp10 commented Sep 14, 2026

Copy link
Copy Markdown

Root cause of the failed PR creation in run 34838458569

gh resolves the repository for PR/issue commands from the git remotes and prefers a remote literally named upstream over origin. fork-sync.sh adds exactly such a remote (pointing at actions/runner) before fetching release tags — so inside the job:

  • gh pr list silently queried actions/runner → found nothing
  • gh pr create tried to create the PR in actions/runner → Resource not accessible by integration

Everything else in that run worked — merge, workflow pinning, patch gate, and the branch push (the workflows-permission problem is solved; this was the last broken step).

Fix

  • The workflow now exports GH_REPO: ${{ github.repository }} for the job
  • The script also derives GH_REPO from the origin remote as a local fallback (https and ssh URL forms), and only exports it when it parses to an owner/repo slug

The sync PR itself (2.337.0) was opened manually as #5; with this merged, tomorrow's run will find it open, leave a comment, and exit cleanly instead of failing.

gh resolves the repository for PR/issue commands from the git
remotes and prefers one literally named "upstream". fork-sync.sh
adds exactly such a remote (actions/runner) before fetching release
tags, so every gh call it makes — pr list, pr create, issue create —
targeted actions/runner instead of the fork:

  pull request create failed: GraphQL: Resource not accessible
  by integration (createPullRequest)

The run otherwise succeeded: the merge, workflow pinning, patch gate
and branch push all worked, only the final PR creation failed.

Fix: export GH_REPO for the whole script, set from the workflow for
CI runs and derived from the origin remote locally (https and ssh
forms). Also list the three hand-fixes to fork-sync.yml permissions
in the fork-patches manifest so the gate output stays clean.
@sc0rp10
sc0rp10 merged commit e35256d into main Sep 14, 2026
10 checks passed
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