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
{{ message }}
Repository navigation
[plan] Strip stale-check from on: block before YAML serialization #24426
Fix a bug where on.stale-check: false in workflow frontmatter is emitted into the compiled GitHub Actions YAML, producing invalid YAML that GitHub rejects.
Context
Closes part of #24422. The stale-check key is an internal gh-aw compiler flag. The compiler reads it from the on: map and sets WorkflowData.StaleCheckDisabled = true, but it is never stripped before serialization. The compiled output ends up with:
on:
stale-check: falseworkflow_call:
which GitHub Actions rejects as invalid.
Root Cause
In pkg/workflow/compiler_orchestrator_workflow.go (around line 237), the stale-check value is read from the on: map, but the key is not deleted before extractTopLevelYAMLSection serializes the whole on: block at line 262.
Other internal gh-aw flags (e.g., manual-approval, stop-after, skip-if-match, roles, bots) are stripped in frontmatter_extraction_yaml.go inside commentOutProcessedFieldsInOnSection(). The stale-check key must be added to that same stripping logic.
Approach
In pkg/workflow/frontmatter_extraction_yaml.go, find the commentOutProcessedFieldsInOnSection() function.
Add stale-check to the list of top-level on: keys that are deleted/commented-out before serialization (alongside manual-approval, stop-after, etc.).
Add a unit test in the relevant test file to compile a workflow with on.stale-check: false and assert the compiled YAML does not contain stale-check.
Files to Modify
pkg/workflow/frontmatter_extraction_yaml.go — add stale-check to the stripping logic
Relevant test file (e.g., pkg/workflow/frontmatter_extraction_yaml_test.go or similar) — add test case
Acceptance Criteria
A workflow with on: { workflow_call: {}, stale-check: false } compiles without stale-check in the output YAML
The StaleCheckDisabled field in WorkflowData is still correctly set to true
Activity