Description
The gh aw compile command emits the top-level on: key as a quoted string ("on":) in generated *.lock.yml files, instead of the conventional unquoted on: used throughout GitHub Actions workflows.
Example
See microsoft/aspire/.github/workflows/pr-docs-check.lock.yml#L64:
name: "PR Documentation Check"
"on":
pull_request:
branches:
- main
- release/*
types:
- closed
Generated by gh-aw v0.72.0.
Expected
name: "PR Documentation Check"
on:
pull_request:
...
Why this happens
In YAML 1.1, the bare word on is interpreted as a boolean (true). Many YAML emitters defensively quote it to avoid ambiguity. However, GitHub Actions uses YAML 1.2 (where on is just a string), and every hand-written workflow file in the wild uses the unquoted form. The quoted form, while functionally equivalent and parsed correctly by GitHub Actions, looks inconsistent next to the rest of the ecosystem and trips up syntax highlighters / linters that special-case on: as a workflow trigger.
Severity
Cosmetic / minor — workflows still execute correctly. Filing for awareness; would be a nice polish for generated lock files to match GitHub Actions conventions.
Suggested fix
Either:
- Configure the YAML emitter to treat
on as a non-reserved key (most Go YAML libraries have an option for this), or
- Post-process the emitted YAML to unquote the top-level
on: key.
Description
The
gh aw compilecommand emits the top-levelon:key as a quoted string ("on":) in generated*.lock.ymlfiles, instead of the conventional unquotedon:used throughout GitHub Actions workflows.Example
See microsoft/aspire/.github/workflows/pr-docs-check.lock.yml#L64:
Generated by
gh-aw v0.72.0.Expected
Why this happens
In YAML 1.1, the bare word
onis interpreted as a boolean (true). Many YAML emitters defensively quote it to avoid ambiguity. However, GitHub Actions uses YAML 1.2 (whereonis just a string), and every hand-written workflow file in the wild uses the unquoted form. The quoted form, while functionally equivalent and parsed correctly by GitHub Actions, looks inconsistent next to the rest of the ecosystem and trips up syntax highlighters / linters that special-caseon:as a workflow trigger.Severity
Cosmetic / minor — workflows still execute correctly. Filing for awareness; would be a nice polish for generated lock files to match GitHub Actions conventions.
Suggested fix
Either:
onas a non-reserved key (most Go YAML libraries have an option for this), oron:key.