Enable templatable report-failure-as-issue and shared-workflow propagation#41821
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
report-failure-as-issue and shared-workflow propagation
There was a problem hiding this comment.
Pull request overview
This PR enables safe-outputs.report-failure-as-issue to be specified as a GitHub Actions expression string (e.g. ${{ inputs.report-failure-as-issue }}) in addition to the existing boolean and category-array modes, and ensures that value propagates correctly through shared-workflow imports and into the generated conclusion job environment.
Changes:
- Extended safe-outputs parsing/schema to accept expression strings for
report-failure-as-issuewhile preserving existing boolean and category-array behavior. - Updated shared-workflow safe-outputs merge to propagate
report-failure-as-issue(and parsed category include/exclude filters) when the main workflow doesn’t override it. - Updated conclusion job env emission to render templated
GH_AW_FAILURE_REPORT_AS_ISSUEexpressions directly, and to omit category filter env vars when enablement is expression-driven.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/safe_outputs_config.go | Parses report-failure-as-issue as categories array or templatable boolean expression, storing the right internal representation. |
| pkg/workflow/imports.go | Merges report-failure-as-issue plus include/exclude category filters from imported shared workflows when not overridden. |
| pkg/workflow/notify_comment.go | Renders GH_AW_FAILURE_REPORT_AS_ISSUE as either a literal or expression; conditionally emits category filter env vars. |
| pkg/parser/schemas/main_workflow_schema.json | Allows expression-string form for safe-outputs.report-failure-as-issue in the main workflow schema. |
| .github/aw/safe-outputs-runtime.md | Documents expression support for report-failure-as-issue. |
| pkg/workflow/safe_outputs_import_test.go | Adds coverage for shared-workflow propagation and main-workflow precedence with templated values. |
| pkg/workflow/notify_comment_test.go | Adds coverage ensuring templated env rendering and omission of category filter env vars for expression-driven enablement. |
| pkg/workflow/compiler_safe_outputs_config_test.go | Adds coverage for parsing templatable expression strings into ReportFailureAsIssue. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 9/9 changed files
- Comments generated: 0
- Review effort level: Low
🤖 PR Triage
Score breakdown: Impact 20 · Urgency 5 · Quality 5 Adds customization for
|
|
@copilot merge main and recompile |
…se-report-failure-issue # Conflicts: # pkg/workflow/notify_comment.go Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
/review |
|
✅ PR Code Quality Reviewer completed the code quality review. |
|
@copilot update JavaScript to handle expression that resolve to false dynamically. |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot reuse existing ref type for employable Boolean in json schema |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
🤖 PR Triage — §28282332784
Rationale: Templatable report-failure-as-issue is a useful workflow customization. Promoted from draft; no CI data yet. Batch-review with related feature PRs.
|
|
@copilot please run the
|
PR Triage Update — §28289524040
|
|
@copilot please run the
|
Reusable workflows could not parameterize
safe-outputs.report-failure-as-issuewithout post-compile lock-file edits, because only literal booleans/arrays were handled end-to-end. This change makes the field templatable and ensures shared workflow definitions flow through compile-time merge and runtime env wiring.Parser and schema support
safe-outputs.report-failure-as-issuein the main workflow schema (alongside existing bool and category-array modes).true/falseas literal booleans${{ ... }}as templated boolean expressions[]category filters as existing include/exclude behavior.Shared workflow merge behavior
report-failure-as-issueand its parsed include/exclude category filters from shared workflows.Conclusion job env rendering
GH_AW_FAILURE_REPORT_AS_ISSUEemission to support templated values directly in generated workflow YAML.Docs alignment
report-failure-as-issue.pr-sous-chef: requested branch refresh from run https://github.com/github/gh-aw/actions/runs/28282929337
pr-sous-chef: https://github.com/github/gh-aw/actions/runs/28290235301