You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When protected-files: { policy: fallback-to-issue } is configured and a PR touches a protected file, gh-aw creates a tracking issue with a compare URL like:
The user then manually opens a PR from that link. However, merging the PR does not auto-close the issue because the pre-filled PR body does not contain Closes #N.
The issue stays open and must be manually closed after merge.
Relationship to auto-close-issue
The existing auto-close-issue feature (default: true) on create-pull-request already solves this for issue-triggered workflows — it auto-appends Fixes #N to the PR body when the workflow trigger is an issue. From the docs:
By default, when a workflow is triggered from an issue, the create-pull-request handler automatically appends - Fixes #N to the PR description if no closing keyword is already present.
However, in the fallback-to-issue flow, the issue is created mid-run by the safe-outputs handler itself, not the workflow trigger. So auto-close-issue doesn't apply — there's no triggering issue at the time the compare URL is generated.
At step 3, the issue number is already known. The only change needed is appending &body=Closes%20%23<issue_number> to the compare URL that's already being constructed.
Proposed Solution
Include a body query parameter in the compare URL:
When the user clicks the link and creates the PR, the body is pre-filled with Closes #N, and merging auto-closes the tracking issue. No flow restructuring required — just extend the URL that's already being built.
Problem
When
protected-files: { policy: fallback-to-issue }is configured and a PR touches a protected file, gh-aw creates a tracking issue with a compare URL like:The user then manually opens a PR from that link. However, merging the PR does not auto-close the issue because the pre-filled PR body does not contain
Closes #N.The issue stays open and must be manually closed after merge.
Relationship to
auto-close-issueThe existing
auto-close-issuefeature (default:true) oncreate-pull-requestalready solves this for issue-triggered workflows — it auto-appendsFixes #Nto the PR body when the workflow trigger is an issue. From the docs:However, in the
fallback-to-issueflow, the issue is created mid-run by the safe-outputs handler itself, not the workflow trigger. Soauto-close-issuedoesn't apply — there's no triggering issue at the time the compare URL is generated.Current Flow (no structural change needed)
At step 3, the issue number is already known. The only change needed is appending
&body=Closes%20%23<issue_number>to the compare URL that's already being constructed.Proposed Solution
Include a
bodyquery parameter in the compare URL:When the user clicks the link and creates the PR, the body is pre-filled with
Closes #N, and merging auto-closes the tracking issue. No flow restructuring required — just extend the URL that's already being built.Context
Example issue created by the fallback flow: kaovilai/kaovilai#54
The compare URL has
titlepre-filled but nobody.Note
Responses generated with Claude