Skip to content

Add do-not-edit notice as first line of lock.yml files - #38415

Closed
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/add-fist-comment-line-lock-yml
Closed

Add do-not-edit notice as first line of lock.yml files#38415
pelikhan with Copilot wants to merge 2 commits into
mainfrom
copilot/add-fist-comment-line-lock-yml

Conversation

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Lock files generated by gh aw compile had 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:
    # This file was auto-generated by "gh aw compile" from https://github.com/github/gh-aw. Do not edit directly.
    
  • pkg/workflow/redact_secrets_test.go: updates ordering assertions — new notice is lines[0], # gh-aw-metadata shifts to lines[1]
  • 245 .lock.yml files regenerated via make recompile

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add do-not-edit comment as first line of lock.yml files Add do-not-edit notice as first line of lock.yml files Jun 10, 2026
Copilot AI requested a review from pelikhan June 10, 2026 17:33
@pelikhan
pelikhan marked this pull request as ready for review June 10, 2026 17:51
Copilot AI review requested due to automatic review settings June 10, 2026 17:51
@pelikhan

Copy link
Copy Markdown
Collaborator

Update sentence to include https://github.com/github/gh-aw

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot update sentence to include https://github.com/github/gh-aw

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.yml workflows 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@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>

Copilot AI commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update sentence to include https://github.com/github/gh-aw

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.

Copilot AI requested a review from pelikhan June 10, 2026 18:19
@pelikhan pelikhan closed this Jun 10, 2026
Copilot stopped work on behalf of pelikhan due to an error June 10, 2026 18:24
@github-actions
github-actions Bot deleted the copilot/add-fist-comment-line-lock-yml branch June 18, 2026 03:01
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