Comment out stale-check in generated lock.yml#24435
Conversation
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>
There was a problem hiding this comment.
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
commentOutProcessedFieldsInOnSectionto comment outstale-check:in the compiled"on":section. - Added test assertions ensuring
stale-checkis 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
| // 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 |
There was a problem hiding this comment.
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.
| // 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. |
stale-checkis a gh-aw extension key in theon: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— Addedstale-check:tocommentOutProcessedFieldsInOnSection, alongside other processed fields likemanual-approval,skip-roles, etc.stale_check_test.go— Added assertions verifyingstale-checkis emitted as a comment (not an active key) in the lock file.on.stale-checknow produces: