fix(ci): repair doc-audit workflow YAML and JS escaping#1168
Open
kcenon wants to merge 1 commit into
Open
Conversation
doc-audit.yml failed to register and produced a startup_failure on every push
(jobs=0, "workflow file issue"). The github-script `script:` block scalar was
malformed: the createComment body used a backtick template literal whose
`${report}` line sat at column 0, terminating the block scalar and making the
workflow YAML unparseable (ScannerError). Inline the body as a single
`\n\n`-separated line so it stays within the block scalar indentation.
Also fix the invalid JavaScript escape `\!` -> `!` in the two early-return
guards (`if (\!fs.existsSync(...))`, `if (\!report.trim())`), which would
throw a SyntaxError if the comment step ever executed.
Validated with yaml.safe_load (on: [pull_request], jobs: [audit]).
Contributor
Coverage Report
Coverage DetailsFull HTML report is available as a build artifact. |
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.
What
Fix the
Documentation Auditworkflow (.github/workflows/doc-audit.yml),which fails with a
startup_failureon every push.Change type: fix(ci) — workflow file only.
Why
The workflow YAML is unparseable, so GitHub cannot register it and records a
startup_failure(jobs=0) for every push event — a persistent red mark acrossall branches since the file was added.
Root cause: in the
Comment on PRstep'sactions/github-scriptscript:block scalar, the
createCommentbody is a backtick template literal whose${report}line sits at column 0. That line is less-indented than the blockscalar, so YAML treats it as a new mapping key and fails
(
ScannerError: could not find expected ':'). A secondary defect: the twoguard lines use the invalid JS escape
\!instead of!.Where
.github/workflows/doc-audit.yml:`## Documentation Audit Report\n\n${report}`(keeps it inside the block scalar).if (\!fs.existsSync(...))/if (\!report.trim())->!(valid JS).How (verification)
yaml.safe_loadnow parses the file (on: [pull_request],jobs: [audit]).After merge, push events no longer create
startup_failureruns, and theaudit runs as intended on PRs touching
docs/**,README*.md, orCLAUDE.md.This same template defect exists across the kcenon repos; the fix is applied to
each. (The identical file on
mainshould receive the same fix via the nextrelease-merge.)