Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 500
feat: add safe-outputs.failure-issue-repo to redirect failure issues to a different repo#20429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
016f56aced4c548319f70c38f0d9021e193File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -205,6 +205,11 @@ func (c *Compiler) buildConclusionJob(data *WorkflowData, mainJobName string, sa | ||
| agentFailureEnvVars = append(agentFailureEnvVars, " GH_AW_FAILURE_REPORT_AS_ISSUE: \"true\"\n") | ||
| } | ||
| // Pass failure-issue-repo configuration (optional, defaults to current repo) | ||
| if data.SafeOutputs != nil && data.SafeOutputs.FailureIssueRepo != "" { | ||
| agentFailureEnvVars = append(agentFailureEnvVars, fmt.Sprintf(" GH_AW_FAILURE_ISSUE_REPO: %q\n", data.SafeOutputs.FailureIssueRepo)) | ||
| } | ||
Comment on lines
+208
to
+211
CopilotAI | ||
| // Pass timeout minutes value so the failure handler can provide an actionable hint when timed out | ||
| timeoutValue := strings.TrimPrefix(data.TimeoutMinutes, "timeout-minutes: ") | ||
| if timeoutValue != "" { | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -469,6 +469,14 @@ func (c *Compiler) extractSafeOutputsConfig(frontmatter map[string]any) *SafeOut | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| // Handle failure-issue-repo (repository for failure issues, format: "owner/repo") | ||||||||||||||||||||||||||||||
| if failureIssueRepo, exists := outputMap["failure-issue-repo"]; exists { | ||||||||||||||||||||||||||||||
| if failureIssueRepoStr, ok := failureIssueRepo.(string); ok && failureIssueRepoStr != "" { | ||||||||||||||||||||||||||||||
| config.FailureIssueRepo = failureIssueRepoStr | ||||||||||||||||||||||||||||||
| safeOutputsConfigLog.Printf("Failure issue repo: %s", failureIssueRepoStr) | ||||||||||||||||||||||||||||||
Comment on lines
+474
to
+476
CopilotAI | ||||||||||||||||||||||||||||||
| iffailureIssueRepoStr, ok:=failureIssueRepo.(string); ok&&failureIssueRepoStr!="" { | |
| config.FailureIssueRepo=failureIssueRepoStr | |
| safeOutputsConfigLog.Printf("Failure issue repo: %s", failureIssueRepoStr) | |
| iffailureIssueRepoStr, ok:=failureIssueRepo.(string); ok { | |
| trimmed:=strings.TrimSpace(failureIssueRepoStr) | |
| iftrimmed!="" { | |
| parts:=strings.Split(trimmed, "/") | |
| iflen(parts) ==2&&parts[0] !=""&&parts[1] !="" { | |
| config.FailureIssueRepo=trimmed | |
| safeOutputsConfigLog.Printf("Failure issue repo: %s", trimmed) | |
| } else { | |
| safeOutputsConfigLog.Printf("Ignoring invalid failure-issue-repo %q; expected format owner/repo", failureIssueRepoStr) | |
| } | |
| } |
Uh oh!
There was an error while loading. Please reload this page.
CopilotAIMar 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Parsing
GH_AW_FAILURE_ISSUE_REPOwithsplit("/")and taking the first two elements can silently mis-handle invalid values (e.g.owner/,/repo, orowner/repo/extra), leading to API calls against the wrong repo or to hard-to-diagnose failures. Recommend validating that the value matches exactlyowner/repo(two non-empty segments, no extra/) and logging a warning + falling back tocontext.repowhen invalid.This issue also appears on line 703 of the same file.