Skip to content

ci: Linear <-> GitHub PR sync automation#1441

Open
tcharchian wants to merge 4 commits into
mainfrom
ci/linear-pr-sync
Open

ci: Linear <-> GitHub PR sync automation#1441
tcharchian wants to merge 4 commits into
mainfrom
ci/linear-pr-sync

Conversation

@tcharchian

@tcharchian tcharchian commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a custom GitHub Action that mirrors every pull request (including PRs from external forks) into Linear and keeps issues in sync with the PR lifecycle. Internal Linear comments stay private (never pushed to GitHub).

  • opened: parent issue in the GON team Triage; first-time-contributor label; per-reviewer "<title> — review needed" sub-issues (Backlog); auto-requests reviewers on the PR (author excluded/swapped).
  • milestoned: moves parent + sub-issues into the Upgrade <milestone> release project (created if missing).
  • review approved: that reviewer's sub-issue → Done.
  • merged: parent → Merged. Ready for testing; each review sub-issue → Done only if that reviewer approved, else Not done; creates a Q&A "<title> — Testing" sub-issue (Todo, assigned to QA owner).
  • closed by a reviewer: parent Done, their sub Done, other Cancelled.
  • closed by anyone else: parent + review sub-issues → Cancelled.
  • merged/approved without a milestone: parked in an "unsorted" project for manual sorting.

Implemented with pull_request_target (+ pull_request_review) so it works for fork PRs; PR code is never checked out or executed. Identities, states, projects and labels are resolved by name at runtime.

Files:

  • .github/workflows/linear-pr-sync.yml
  • .github/scripts/linear-pr-sync/ (script + README)
  • docs/linear-github-sync.md

Required setup before this works

  • Secret LINEAR_API_KEY.
  • Variables LINEAR_TEAM_KEY=GON and LINEAR_REVIEWERS (GitHub↔Linear mapping).
  • Workflow triggers run from the version on main, so this must be merged to take effect.

Test plan

  • Add the secret + variables.
  • Open a test PR → parent + review sub-issues created, reviewers requested.
  • Set a milestone → issues move to the release project.
  • Approve + merge → parent "Merged. Ready for testing", QA testing sub-issue created.
  • Close a PR unmerged by a non-reviewer → parent + review sub-issues Cancelled.

tcharchian and others added 4 commits July 10, 2026 12:01
Adds a custom GitHub Action that mirrors every pull request (including
external fork PRs) into Linear and keeps issues in sync with the PR
lifecycle:

- opened: parent issue in the GON team Triage, first-time-contributor
  label, per-reviewer "review needed" sub-issues, and auto-requests the
  reviewers on the PR (author is excluded / swapped)
- milestoned: moves parent + sub-issues into the "Upgrade <milestone>"
  release project (created if missing)
- review approved: reviewer's sub-issue -> Done
- merged: parent -> "Merged. Ready for testing"; each review sub-issue ->
  Done only if that reviewer approved, else "Not done"; creates a Q&A
  "Testing" sub-issue (Todo, assigned to QA owner)
- closed by a reviewer: parent Done, their sub Done, other Cancelled
- closed by anyone else: parent Cancelled, review subs "Not done"
- merged/approved without a milestone: parked in an "unsorted" project

Config via LINEAR_API_KEY secret + repository variables; identities,
states, projects and labels are resolved by name at runtime.

Co-authored-by: Cursor <cursoragent@cursor.com>
Previously review sub-issues were set to "Not done" when a PR was closed
unmerged by someone other than a reviewer; make them "Cancelled" instead
(the parent is already Cancelled). "Not done" remains for the merged-but-
not-approved case.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Tania Charchian <tatiana.charchian@productscience.ai>
Signed-off-by: Tania Charchian <tatiana.charchian@productscience.ai>
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