File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ async function main(config = {}) {
174174
175175 const includeFooter = parseBoolTemplatable ( config . footer , true ) ;
176176 const fallbackAsIssue = config . fallback_as_issue !== false ; // Default to true (fallback enabled)
177+ const autoCloseIssue = parseBoolTemplatable ( config . auto_close_issue , true ) ; // Default to true (auto-close enabled)
177178
178179 // Environment validation - fail early if required variables are missing
179180 const workflowId = process . env . GH_AW_WORKFLOW_ID ;
@@ -557,12 +558,15 @@ async function main(config = {}) {
557558 // Auto-add "Fixes #N" closing keyword if triggered from an issue and not already present.
558559 // This ensures the triggering issue is auto-closed when the PR is merged.
559560 // Agents are instructed to include this but don't reliably do so.
560- if ( triggeringIssueNumber ) {
561+ // This behavior can be disabled by setting auto-close-issue: false in the workflow config.
562+ if ( triggeringIssueNumber && autoCloseIssue ) {
561563 const hasClosingKeyword = / (?: f i x | f i x e s | f i x e d | c l o s e | c l o s e s | c l o s e d | r e s o l v e | r e s o l v e s | r e s o l v e d ) \s + # \d + / i. test ( processedBody ) ;
562564 if ( ! hasClosingKeyword ) {
563565 processedBody = processedBody . trimEnd ( ) + `\n\n- Fixes #${ triggeringIssueNumber } ` ;
564566 core . info ( `Auto-added "Fixes #${ triggeringIssueNumber } " closing keyword to PR body as bullet point` ) ;
565567 }
568+ } else if ( triggeringIssueNumber && ! autoCloseIssue ) {
569+ core . info ( `Skipping auto-close keyword for #${ triggeringIssueNumber } (auto-close-issue: false)` ) ;
566570 }
567571
568572 let bodyLines = processedBody . split ( "\n" ) ;
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ interface CreatePullRequestConfig extends SafeOutputConfig {
8484 draft ?: boolean ;
8585 "if-no-changes" ?: string ;
8686 footer ?: boolean ;
87+ "auto-close-issue" ?: boolean | string ;
8788}
8889
8990/**
You can’t perform that action at this time.
0 commit comments