Add do-not-edit notice as first line of lock.yml files#38415
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Update sentence to include https://github.com/github/gh-aw |
|
@copilot update sentence to include https://github.com/github/gh-aw |
There was a problem hiding this comment.
Pull request overview
This PR adds an explicit “do not edit” sentinel line to the top of generated workflow lock files so automated agents (and humans) have a clear, stable signal that .lock.yml is compiler output and should not be hand-edited.
Changes:
- Emit
# This file was auto-generated by "gh aw compile". Do not edit directly.as the first line of generated lock files. - Update the lock-header ordering test to account for the new first-line notice.
- Regenerate existing
.lock.ymlworkflows to include the notice.
Show a summary per file
| File | Description |
|---|---|
| pkg/workflow/compiler_yaml.go | Writes the new do-not-edit notice before the existing # gh-aw-metadata header emission. |
| pkg/workflow/redact_secrets_test.go | Adjusts assertions to ensure the notice is line 0 and # gh-aw-metadata is line 1, plus ordering checks. |
| .github/workflows/*.lock.yml | Regenerated lock files to include the new notice as the first line. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 247/247 changed files
- Comments generated: 0
| # \ /\ / (_) | | | | ( | | | | (_) \ V V /\__ \ | ||
| # \/ \/ \___/|_| |_|\_\|_| |_|\___/ \_/\_/ |___/ | ||
| # | ||
| # This file was automatically generated by gh-aw. DO NOT EDIT. |
There was a problem hiding this comment.
@copilot this line is unnecessary because it was moved to the first line of the file.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Updated in b8b0553. The generated first-line notice now includes https://github.com/github/gh-aw, and lock files were recompiled with the new sentence. |
Lock files generated by
gh aw compilehad no machine-readable signal at the top to deter agents from editing them directly.Changes
pkg/workflow/compiler_yaml.go: emits the following as the absolute first line of every lock.yml, before# gh-aw-metadata:pkg/workflow/redact_secrets_test.go: updates ordering assertions — new notice islines[0],# gh-aw-metadatashifts tolines[1].lock.ymlfiles regenerated viamake recompile