Skip to content

Add --github-pr-lookup to find pull requests merged by fast-forward or rebase - #158

Open
asakin wants to merge 1 commit into
linear:mainfrom
asakin:github-pr-lookup
Open

asakin wants to merge 1 commit into
linear:mainfrom
asakin:github-pr-lookup

Conversation

@asakin

@asakin asakin commented Nov 28, 2026 •

Copy link
Copy Markdown

Fixes #159

sync finds pull requests only through the text GitHub writes into merge (Merge pull request #42) and squash (Title (#42)) commits. Pull requests merged by fast-forward or rebase leave plain commits, so their linked issues never reach the release (#100).

--github-pr-lookup asks GitHub instead. For each scanned commit whose message names no pull request (and that isn't a revert), it queries associatedPullRequests over GraphQL, 50 commits per request, keeps the merged ones, and sends their numbers with the rest. Linear's server already resolves pull request numbers to their issues, so nothing else changes.

  • Opt-in; reads the token from GITHUB_TOKEN (or GH_TOKEN). Works on github.com, GitHub Enterprise Cloud and Server.
  • If the lookup fails, sync warns and continues with the pull requests found in commit messages.
  • Only full SHAs go into the query.

Tested with unit tests (src/github.test.ts) and against a real repository whose pull requests are merged both ways: merge-commit and fast-forward pull requests both resolve to their numbers, direct pushes to none.

The action would need an input that passes the flag and the workflow token; happy to send that once this ships.

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.

Find pull requests merged by fast-forward or rebase through the GitHub API

1 participant