fix(ci): unbreak release workflow (workflow_dispatch was never registered)#2
Merged
Merged
Conversation
…-run check
The Bump version step had `npm version ... -m "chore(release): %s"` as an
unquoted YAML plain scalar. The `): ` inside the message ended the scalar
early and produced "bad indentation of a mapping entry", which made GitHub
reject the whole workflow at registration time — the file showed up under
its raw path instead of `Release`, every push produced a 0s failure run,
and `workflow_dispatch` was never wired up. Switch to a block scalar so
the message survives parsing.
While here:
- `if: ${{ inputs.dry_run != 'true' }}` compared a boolean input to the
literal string `'true'`. Replace with `!inputs.dry_run` so the check
matches the declared input type.
- Add a Check spec drift step. `npm version` requires a clean working
tree, and a drifted `spec/openapi.json` would also publish something
different from what is on main. Fail fast and ask the operator to
commit the refreshed spec first.
- Add `.gitattributes` forcing LF on `*.yml` / `*.yaml`, and normalize
the existing workflow files. Some YAML tooling is sensitive to CRLF
and a silently-malformed workflow file is hard to debug.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Why
The release workflow has been silently broken since it was added. In the Actions tab the workflow showed up as
.github/workflows/release.yml(its raw path) instead ofRelease, every push produced a 0-second failure run with the message "This run likely failed because of a workflow file issue", and the manual Run workflow button was never functional —workflow_dispatchwas never actually wired up.Root cause
.github/workflows/release.ymlline 53 was:The
run:value is a YAML plain scalar (no surrounding quotes). The):insidechore(release): %sis acolon + space, which terminates a plain scalar — the"characters around the message are just literal text in plain-scalar context, not string delimiters. js-yaml reportsbad indentation of a mapping entry (53:63), and GitHub rejects the whole file at registration.Changes
npm versioncommand in a block scalar so the colon survives parsing.if: ${{ inputs.dry_run != 'true' }}withif: ${{ !inputs.dry_run }}— the previous check compared atype: booleaninput against the literal string'true'.Check spec driftstep betweensync-specandgenerate.npm versionrequires a clean working tree, and a driftedspec/openapi.jsonwould also publish something different from what is on main. Fail fast and ask the operator to commit the refreshed spec first..gitattributespinning*.yml/*.yamlto LF, and normalize the existing workflow files. CRLF in workflow YAML is a common silent-failure trap.Verification
Local
js-yamlparse now succeeds and surfaces the expected structure:How to test after merge
bump(patch/minor/major) anddry_runinputs.dry_run: trueto confirm:npm publish --dry-runfires, and Push tag + GitHub release both skip.dry_run: falsefor the real bump.🤖 Generated with Claude Code