Skip to content

[plan] Strip stale-check from on: block before YAML serialization #24426

Closed

Description

@github-actions

Objective

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: false
  workflow_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

  1. In pkg/workflow/frontmatter_extraction_yaml.go, find the commentOutProcessedFieldsInOnSection() function.
  2. Add stale-check to the list of top-level on: keys that are deleted/commented-out before serialization (alongside manual-approval, stop-after, etc.).
  3. 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
  • make agent-finish passes (build, test, fmt, lint)
    Related to Remote workflow call still broken #24422

Generated by Plan Command for issue #24422 · ● 320.3K · ◷

  • expires on Apr 6, 2026, 3:28 AM UTC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions