Skip to content

Comment out stale-check in generated lock.yml#24435

Merged
pelikhan merged 1 commit intomainfrom
copilot/update-compiler-comment-out-stale-check
Apr 4, 2026
Merged

Comment out stale-check in generated lock.yml#24435
pelikhan merged 1 commit intomainfrom
copilot/update-compiler-comment-out-stale-check

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

stale-check is a gh-aw extension key in the on: frontmatter section. It was being emitted as an active YAML key in compiled lock files, which is incorrect — GitHub Actions doesn't recognize it and it belongs only as documentation.

Changes

  • frontmatter_extraction_yaml.go — Added stale-check: to commentOutProcessedFieldsInOnSection, alongside other processed fields like manual-approval, skip-roles, etc.
  • stale_check_test.go — Added assertions verifying stale-check is emitted as a comment (not an active key) in the lock file.
  • Lock files — Recompiled all workflows; any workflow with on.stale-check now produces:
"on":
  issues:
    types:
    - opened
  # stale-check: false # Stale-check processed as frontmatter hash check step in activation job

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/0c454581-6ea8-44b4-a206-4d0e533021aa

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review April 4, 2026 03:54
Copilot AI review requested due to automatic review settings April 4, 2026 03:54
@pelikhan pelikhan merged commit 83c609b into main Apr 4, 2026
52 checks passed
@pelikhan pelikhan deleted the copilot/update-compiler-comment-out-stale-check branch April 4, 2026 03:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes generated lock workflow YAML so the on.stale-check gh-aw extension key is emitted as a comment (documentation-only) rather than as an active GitHub Actions trigger key.

Changes:

  • Updated commentOutProcessedFieldsInOnSection to comment out stale-check: in the compiled "on": section.
  • Added test assertions ensuring stale-check is not emitted as an active YAML key in lock output when present in frontmatter.
Show a summary per file
File Description
pkg/workflow/frontmatter_extraction_yaml.go Comments out stale-check: in the compiled on: YAML and annotates it with a reason.
pkg/workflow/stale_check_test.go Adds assertions validating stale-check is commented out (and not an active key) in generated lock output.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines +103 to 105
// commentOutProcessedFieldsInOnSection comments out draft, fork, forks, names, manual-approval, stop-after, skip-if-match, skip-if-no-match, skip-roles, reaction, lock-for-agent, steps, permissions, and stale-check fields in the on section
// These fields are processed separately and should be commented for documentation
// Exception: names fields in sections with __gh_aw_native_label_filter__ marker in frontmatter are NOT commented out
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The function doc comment enumerates which on: fields are commented out, but the implementation also comments additional extension keys (e.g., skip-bots, roles, bots, github-token, github-app, skip-if-check-failing, etc.). Since this list is now inaccurate, consider either updating it to reflect all commented keys or rewriting it more generally (e.g., “comments out gh-aw extension keys processed elsewhere”) to avoid future drift.

Suggested change
// commentOutProcessedFieldsInOnSection comments out draft, fork, forks, names, manual-approval, stop-after, skip-if-match, skip-if-no-match, skip-roles, reaction, lock-for-agent, steps, permissions, and stale-check fields in the on section
// These fields are processed separately and should be commented for documentation
// Exception: names fields in sections with __gh_aw_native_label_filter__ marker in frontmatter are NOT commented out
// commentOutProcessedFieldsInOnSection comments out gh-aw extension keys in the on
// section that are processed separately and should be preserved as comments for
// documentation. Exception: names fields in sections with
// __gh_aw_native_label_filter__ marker in frontmatter are NOT commented out.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants