Skip to content

Enable templatable report-failure-as-issue and shared-workflow propagation#41821

Merged
pelikhan merged 8 commits into
mainfrom
copilot/allow-customise-report-failure-issue
Jun 27, 2026
Merged

Enable templatable report-failure-as-issue and shared-workflow propagation#41821
pelikhan merged 8 commits into
mainfrom
copilot/allow-customise-report-failure-issue

Conversation

Copilot AI commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Reusable workflows could not parameterize safe-outputs.report-failure-as-issue without 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

    • Added expression-string support for safe-outputs.report-failure-as-issue in the main workflow schema (alongside existing bool and category-array modes).
    • Updated safe-outputs parsing to treat:
      • true / false as literal booleans
      • ${{ ... }} as templated boolean expressions
      • [] category filters as existing include/exclude behavior.
  • Shared workflow merge behavior

    • Extended safe-outputs import merge to carry report-failure-as-issue and its parsed include/exclude category filters from shared workflows.
    • Preserved top-level workflow precedence when both main and imported configs define the field.
  • Conclusion job env rendering

    • Updated GH_AW_FAILURE_REPORT_AS_ISSUE emission to support templated values directly in generated workflow YAML.
    • Kept category filter env vars tied to compile-time-known enabled states to avoid contradictory configuration when enablement is expression-driven.
  • Docs alignment

    • Updated safe-outputs runtime docs to explicitly document expression support for report-failure-as-issue.
# shared workflow
safe-outputs:
  report-failure-as-issue: ${{ inputs.report-failure-as-issue }}

# generated env (conclusion job)
GH_AW_FAILURE_REPORT_AS_ISSUE: ${{ inputs.report-failure-as-issue }}

pr-sous-chef: requested branch refresh from run https://github.com/github/gh-aw/actions/runs/28282929337

Generated by 👨‍🍳 PR Sous Chef · 48.3 AIC · ⌖ 1.02 AIC · ⊞ 17.2K ·


pr-sous-chef: https://github.com/github/gh-aw/actions/runs/28290235301

Generated by 👨‍🍳 PR Sous Chef · 108.3 AIC · ⌖ 1.03 AIC · ⊞ 17.2K ·

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Allow customization of report-failure-as-issue without manual lock file changes Enable templatable report-failure-as-issue and shared-workflow propagation Jun 27, 2026
Copilot AI requested a review from pelikhan June 27, 2026 01:18
@pelikhan pelikhan marked this pull request as ready for review June 27, 2026 01:18
Copilot AI review requested due to automatic review settings June 27, 2026 01:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-issue while 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_ISSUE expressions 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

@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage

Category feature
Risk 🟡 Medium
Priority Medium (score 30/100)
Action defer · Batch: active-drafts

Score breakdown: Impact 20 · Urgency 5 · Quality 5

Adds customization for report-failure-as-issue without requiring manual lock-file edits — improves reusable workflow UX. Draft/WIP with 0 changes; agent still building. Deferred until implementation complete. Part of pr-batch:active-drafts group (#41824, #41822, #41821).

Generated by 🔧 PR Triage Agent · 87.6 AIC · ⌖ 14.9 AIC · ⊞ 5.4K ·

@pelikhan

Copy link
Copy Markdown
Collaborator

@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>
@pelikhan

Copy link
Copy Markdown
Collaborator

/review

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot update JavaScript to handle expression that resolve to false dynamically.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot reuse existing ref type for employable Boolean in json schema

Copilot AI and others added 2 commits June 27, 2026 05:57
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage — §28282332784

Field Value
Category feature
Risk medium
Score 52/100 (impact 30 + urgency 12 + quality 10)
Action 📋 batch_review (promoted from draft)
Batch feature-promo (#41824, #41821, #41777)

Rationale: Templatable report-failure-as-issue is a useful workflow customization. Promoted from draft; no CI data yet. Batch-review with related feature PRs.

⚠️ Stale label pr-action:defer — superseded by pr-action:batch_review.

Generated by 🔧 PR Triage Agent · 74.7 AIC · ⌖ 8.27 AIC · ⊞ 5.4K ·

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address the remaining review feedback on the templated report-failure-as-issue path, and rerun checks now that the branch refresh has been requested.

Generated by 👨‍🍳 PR Sous Chef · 48.3 AIC · ⌖ 1.02 AIC · ⊞ 17.2K ·

@github-actions

Copy link
Copy Markdown
Contributor

PR Triage Update — §28289524040

Field Value
Category feature
Risk medium
Score 55 / 100 — impact 28, urgency 15, quality 12
Action batch_review — review together with feature-promo batch (#41777 + #41824)
Batch feature-promo

Label conflict: pr-action:defer label is stale (from draft state) and should be removed manually. pr-batch:active-drafts is also stale. Correct action: pr-action:batch_review.

Generated by 🔧 PR Triage Agent · 90.3 AIC · ⌖ 11.7 AIC · ⊞ 5.4K ·

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, rebase or merge main if needed, address any unresolved review feedback, and rerun checks after the branch is up to date.

Generated by 👨‍🍳 PR Sous Chef · 108.3 AIC · ⌖ 1.03 AIC · ⊞ 17.2K ·

@pelikhan pelikhan merged commit 20404a2 into main Jun 27, 2026
38 checks passed
@pelikhan pelikhan deleted the copilot/allow-customise-report-failure-issue branch June 27, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants