Skip to content

fix(ci): unbreak release workflow (workflow_dispatch was never registered)#2

Merged
yurenju merged 1 commit into
mainfrom
claude/stupefied-yalow-f6aae4
May 27, 2026
Merged

fix(ci): unbreak release workflow (workflow_dispatch was never registered)#2
yurenju merged 1 commit into
mainfrom
claude/stupefied-yalow-f6aae4

Conversation

@yurenju
Copy link
Copy Markdown
Contributor

@yurenju yurenju commented May 27, 2026

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 of Release, 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_dispatch was never actually wired up.

Root cause

.github/workflows/release.yml line 53 was:

run: npm version ${{ inputs.bump }} -m "chore(release): %s"

The run: value is a YAML plain scalar (no surrounding quotes). The ): inside chore(release): %s is a colon + space, which terminates a plain scalar — the " characters around the message are just literal text in plain-scalar context, not string delimiters. js-yaml reports bad indentation of a mapping entry (53:63), and GitHub rejects the whole file at registration.

Changes

  • Wrap the npm version command in a block scalar so the colon survives parsing.
  • Replace if: ${{ inputs.dry_run != 'true' }} with if: ${{ !inputs.dry_run }} — the previous check compared a type: boolean input against the literal string 'true'.
  • Add a Check spec drift step between sync-spec and generate. 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 pinning *.yml / *.yaml to LF, and normalize the existing workflow files. CRLF in workflow YAML is a common silent-failure trap.

Verification

Local js-yaml parse now succeeds and surfaces the expected structure:

name: Release
triggers: [ 'workflow_dispatch' ]
steps: 13

How to test after merge

  1. Go to Actions → Release → Run workflow — the button should now appear with bump (patch/minor/major) and dry_run inputs.
  2. Run once with dry_run: true to confirm: npm publish --dry-run fires, and Push tag + GitHub release both skip.
  3. Then run with dry_run: false for the real bump.

🤖 Generated with Claude Code

…-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>
@yurenju yurenju merged commit db62158 into main May 27, 2026
1 check passed
@yurenju yurenju deleted the claude/stupefied-yalow-f6aae4 branch May 27, 2026 02:58
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