Repository navigation
Conversation
Adds a pull_request_target workflow that labels, comments on and closes PRs with no linked issue, and reopens them once the description references one. Org members, anyone with write access, bots, PRs opened before the cutoff and PRs labelled no-issue-needed are skipped. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…erride - Require a closing keyword (Closes/Fixes/Resolves) or sidebar link to an open issue in this repo; plain mentions no longer count. - A maintainer reopening a closed PR adds no-issue-needed instead of the check closing it again. - Adding no-issue-needed to a flagged PR removes the flag and reopens it. - Post the explanation comment only the first time a PR is closed. - Re-read the PR at the start of each run so labels/state are current. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ption Drop the description regex and query closingIssuesReferences up to 4 times, 5s apart, so links GitHub has not indexed yet are not missed. If every lookup errors, fail the run instead of closing the PR. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
CONTRIBUTING.md asks every contribution to start with an issue, but nothing enforces it. This adds a workflow that closes community pull requests that don't close an open issue, and reopens them once they do.
Changes
.github/workflows/require-linked-issue.yml, running onpull_request_target(opened,reopened,edited,labeled). It never checks out PR code, and re-reads the PR at the start of each run so labels, state and body are current. Runs for the same PR are queued, not cancelled.needs-linked-issuelabel, a comment explaining how to fix it, and is closed. The comment is only posted the first time; later re-closes don't repeat it. Editing the description to close an issue removes the label and reopens the PR.closingIssuesReferencesfor it contains an open issue in this repo, i.e. exactly what GitHub shows under "Development" (a closing keyword such asCloses #123in the description, or a sidebar link). Plain mentions (see #123), closed issues and issues in other repos do not count. GitHub links issues a moment after a PR is opened or edited, so the lookup is retried up to 4 times, 5s apart, before the PR is closed. If every lookup errors, the run fails and the PR is left open.no-issue-neededlabel skips the check; on a flagged PR it also removesneeds-linked-issueand reopens it.no-issue-needed(instead of the check closing it again), so later edits by the author don't re-close it.ENFORCE_AFTER(2026-11-13T00:00:00Z), and PRs carryingno-issue-needed.Known limits: it does not check that a maintainer approved the issue. Linking an issue via the sidebar after the PR is closed does not fire an event, so the PR reopens on the next description edit.
Test Plan
Ran the inline script against mocked GitHub API responses: no link, linked immediately, linked only after retries (indexing delay), only a closed issue, only an issue in another repo, lookup erroring every time (no close) or once, maintainer reopen of a flagged PR, author reopen of a flagged PR (no duplicate comment), reopen on edit, exempt label added to a closed flagged PR, unrelated label added, returning contributor (
CONTRIBUTOR), org member, write access, and pre-cutoff PR. It has not run on GitHub:pull_request_targetworkflows only run from the default branch, so it takes effect after merge.Checklist
🤖 Generated with Claude Code
Link to Devin session: https://app.devin.ai/sessions/957449ac65bf4c50b4c5826645fe1d41
Open in Devin Desktop: https://app.devin.ai/desktop/session/957449ac65bf4c50b4c5826645fe1d41?variant=devin