Skip to content

[Automation] - Issues close prematurely when first PR in a stack merges #131

@MantisClone

Description

@MantisClone

Problem

When using Graphite stacked PRs, we link all PRs in the stack to a single issue. GitHub's default behavior closes the issue when the first PR merges, even though other PRs in the stack are still open. This makes tracking incomplete work difficult and misrepresents progress on the project board.

Proposed Solution

Add a GitHub Action workflow that reopens issues when they're closed while linked PRs are still open. This replicates Linear's behavior where an issue only closes when ALL linked PRs are merged.

The solution consists of:

  1. A reusable workflow in .github repo with the core logic
  2. A caller workflow in each non-archived repo (58 repos)

Considerations

  • Uses GraphQL to query issue timeline for linked PRs, then verifies each PR's closingIssuesReferences to confirm current linkage
  • Handles PRs linked via UI or keywords (Fixes, Closes, Resolves)
  • Handles cross-repo references
  • Requires new fine-grained PAT with Issues (R/W) and Pull requests (R) permissions

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions