Skip to content

pr-from-branch - Support forks - #10137

Merged
fregante merged 3 commits into
refined-github:mainfrom
animesh68:fix/pr-from-branch-sync-fork
Sep 28, 2026
Merged

fregante merged 3 commits into
refined-github:mainfrom
animesh68:fix/pr-from-branch-sync-fork

Conversation

@animesh68

@animesh68 animesh68 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #10128

What this fixes

On forks, GitHub shows a "Sync fork" dropdown next to the "Contribute" button in the branch info bar. Both match button[aria-haspopup="true"], so pr-from-branch tried to unwrap the "Sync fork" button and threw Expected element matching "Contribute", found "Sync fork".

The feature now observes the pull request icon inside the dropdown button (button[aria-haspopup="true"] .octicon-git-pull-request) and resolves the button from it with closestElement. The "Sync fork" button has no such icon, so it is never touched. This avoids :has(), per review feedback. I kept the assertTextContent call so it still fails loudly if GitHub changes the markup again.

Pages affected / tested URLs

Screenshots

After: "Open pull request" replaces "Contribute" while "Sync fork" is present.

image

@github-actions github-actions Bot added the bug label Sep 28, 2026
@github-actions github-actions Bot changed the title pr-from-branch - Fix error on forks with Sync fork button pr-from-branch - Fix error on forks with Sync fork button Sep 28, 2026
Comment thread source/features/pr-from-branch.tsx Resolved
@fregante fregante changed the title pr-from-branch - Fix error on forks with Sync fork button pr-from-branch - Support forks Sep 28, 2026
@fregante
fregante merged commit 9bee66e into refined-github:main Sep 28, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

pr-from-branch Error: Expected element matching "Contribute", found "Sync fork"

2 participants