Skip to content

Add CI check to prevent release-compiled lock files#16216

Merged
pelikhan merged 2 commits intomainfrom
copilot/add-ci-check-for-lock-files
Feb 16, 2026
Merged

Add CI check to prevent release-compiled lock files#16216
pelikhan merged 2 commits intomainfrom
copilot/add-ci-check-for-lock-files

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

Lock files (.lock.yml) in the repository must be compiled with dev builds, not release builds. Release builds inject version numbers into headers (gh-aw (v1.0.0)) which should only appear in distributed binaries, not source-controlled workflows.

Changes

  • New validation step in validate-yaml job
    • Scans all .lock.yml files for version patterns in headers
    • Regex: '# This file was automatically generated by gh-aw \([v0-9]'
    • Matches (v1.0.0), (1.0.0), etc.
    • Fails CI with remediation steps if detected

Header Formats

# Dev build (correct):
# This file was automatically generated by gh-aw. DO NOT EDIT.

# Release build (should fail CI):
# This file was automatically generated by gh-aw (v1.0.0). DO NOT EDIT.

The release flag (-X main.isRelease=true) is set only during scripts/build-release.sh and propagates to header generation via pkg/workflow.isReleaseBuild.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add check in ci.yml for .lock.yml files Add CI check to prevent release-compiled lock files Feb 16, 2026
Copilot AI requested a review from pelikhan February 16, 2026 21:12
@pelikhan pelikhan marked this pull request as ready for review February 16, 2026 21:14
Copilot AI review requested due to automatic review settings February 16, 2026 21:14
@pelikhan pelikhan merged commit 8b790ca into main Feb 16, 2026
124 checks passed
@pelikhan pelikhan deleted the copilot/add-ci-check-for-lock-files branch February 16, 2026 21:16
Copy link
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

This pull request adds a CI validation step to prevent lock files from being compiled with release builds. Release builds inject version numbers into lock file headers (e.g., gh-aw (v1.0.0)), which should only appear in distributed binaries, not in source-controlled workflows. The check ensures all .lock.yml files use dev build headers without version numbers.

Changes:

  • Added validation step in the validate-yaml job to detect release-compiled lock files
  • Uses grep pattern to find version numbers in lock file headers
  • Provides clear error messages and remediation instructions when violations are detected

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

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