Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] The compile command should always validate that the generated lock file is a valid YAML file AND do a schema validation using an embedded copy of the official github actions json schema . Add a step in the makefile to download and save a copy of the gi...
Enhance compile command validation with embedded GitHub Actions schema and always-on YAML validation
Sep 8, 2025
pelikhan
approved these changes
Sep 8, 2025
Contributor
|
note: the vscode extension for github actions also keeps a copy. it cuts one dependency and the JSON schema updates are quite uncommon. |
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR enhances the
gh aw compilecommand's validation capabilities by implementing always-on YAML validation and embedding the official GitHub Actions schema for offline validation. The changes address reliability issues with internet-dependent schema validation and ensure generated workflow files are always syntactically correct.Key Changes
🔄 Always-On YAML Validation
The compile command now always validates that generated lock files are valid YAML, regardless of the
--validateflag setting. This prevents deployment of syntactically broken workflows and catches YAML generation bugs early.📦 Embedded GitHub Actions Schema
Replaced network-dependent schema fetching with an embedded copy of the official GitHub Actions JSON schema:
download-github-actions-schemato refresh the embedded schema🎯 Improved Default Behavior
Changed the
--validateflag default fromfalsetotrue, enabling comprehensive validation by default while maintaining backward compatibility:🛠️ Fixed No-Emit Flag Validation Logic
CompileWorkflowWithValidationto check--no-emitflag explicitly before attempting YAML validationnoEmitparameter for proper validation controlnoEmitparameter--no-emitis enabled, YAML validation is properly skippedTechnical Implementation
Schema Integration
The embedded schema is loaded at compile time and used for validation without external dependencies.
Validation Flow
--no-emitflag is enabled--validate=false)CLI Integration
Enhanced
CompileWorkflowWithValidation()wrapper that ensures all CLI compilation paths include proper validation control based on the--no-emitflag, while preserving existing compiler behavior for tests and internal usage.Benefits
Backward Compatibility
All existing workflows and scripts continue to work unchanged. The
--validate=falseoption remains available for scenarios requiring schema validation to be disabled.Testing
noEmitparameter--no-emitflag properly skips YAML validation as requestedThe implementation successfully addresses the original requirements while enhancing the overall robustness and user experience of the workflow compilation process, with proper handling of the
--no-emitflag validation logic.💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.