Skip to content

fix(ci): repair doc-audit workflow YAML and JS escaping#1168

Open
kcenon wants to merge 1 commit into
developfrom
chore/fix-doc-audit-workflow
Open

fix(ci): repair doc-audit workflow YAML and JS escaping#1168
kcenon wants to merge 1 commit into
developfrom
chore/fix-doc-audit-workflow

Conversation

@kcenon

@kcenon kcenon commented Jun 23, 2026

Copy link
Copy Markdown
Owner

What

Fix the Documentation Audit workflow (.github/workflows/doc-audit.yml),
which fails with a startup_failure on 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 across
all branches since the file was added.

Root cause: in the Comment on PR step's actions/github-script script:
block scalar, the createComment body is a backtick template literal whose
${report} line sits at column 0. That line is less-indented than the block
scalar, so YAML treats it as a new mapping key and fails
(ScannerError: could not find expected ':'). A secondary defect: the two
guard lines use the invalid JS escape \! instead of !.

Where

.github/workflows/doc-audit.yml:

  • Inline the comment body to a single line: `## Documentation Audit Report\n\n${report}` (keeps it inside the block scalar).
  • if (\!fs.existsSync(...)) / if (\!report.trim()) -> ! (valid JS).

How (verification)

yaml.safe_load now parses the file (on: [pull_request], jobs: [audit]).
After merge, push events no longer create startup_failure runs, and the
audit runs as intended on PRs touching docs/**, README*.md, or CLAUDE.md.

This same template defect exists across the kcenon repos; the fix is applied to
each. (The identical file on main should receive the same fix via the next
release-merge.)

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]).
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Metric Value
Line Coverage 70.9%
Branch Coverage 35.3%
Target 80% lines / 70% branches
Coverage Details

Full HTML report is available as a build artifact.

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.

1 participant