feat: label issues close:fixed when a merged PR closes them#213
Merged
Conversation
Add the "Label Fixed Issues on Merge" workflow. On pull_request_target closed, when the PR was merged, it resolves the issues closed via linking keywords (Closes/Fixes/Resolves) using GraphQL closingIssuesReferences and applies the existing close:fixed label to each, keeping the close reason visible in issue triage. Uses pull_request_target so fork PRs still get issues:write; no PR head code is checked out or executed. Skips issues that already carry the label and ensures the label exists with its canonical color/description. Also documents the auto-labeling in CONTRIBUTING.md. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove the defensive label-creation block and the FIXED_LABEL_COLOR/ FIXED_LABEL_DESCRIPTION env vars. issue-labels-sync.yml already defines and creates close:fixed and is the single source of truth for its color and description, so duplicating them here only created a maintenance coupling. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Fail fast via core.setFailed if the label does not exist, rather than letting addLabels silently create a default-colored variant. Signals the label taxonomy is out of sync and the Sync Labels workflow needs to run. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Split the close:fixed existence check out of the apply step into a dedicated 'Verify close:fixed label exists' step that runs first, so the run fails before any labeling work when the label is missing. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
petehauge
approved these changes
Jul 2, 2026
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.
Summary
Adds a new GitHub Actions workflow that automatically applies the existing
close:fixedlabel to issues that were auto-closed by a merged pull request (viaCloses #N/Fixes #N/Resolves #Nlinking keywords). This keeps the close reason visible in issue triage, consistent with the manualclose:*taxonomy defined in the label sync workflow.What the branch delivers
.github/workflows/issue-label-fixed-on-merge.yml("Label Fixed Issues on Merge"):pull_request_target: [closed]and only acts whenpull_request.merged == true.closingIssuesReferences(mirrors exactly what GitHub closed on merge — not fragile PR-body parsing).close:fixedto each closed issue, skipping any that already carry the label.0E8A16/ "Fixed by a previous PR or release") if a fresh repo is missing it.CONTRIBUTING.mdto note that merged PRs auto-label their closed issuesclose:fixed.Design notes
pull_request_target(notpull_request) so PRs from forks still receive anissues: writetoken and get labeled. The workflow never checks out or executes PR head code — it only calls the GitHub API viaactions/github-script— so there is no untrusted-code execution risk.close:fixedlabel itself is already defined in.github/workflows/issue-labels-sync.yml(CLOSE_LABELS); this workflow reuses it.Validation
github-scriptJavaScript passesnode --check.Related Issue(s)
N/A — proactive automation improvement.