Skip to content

fix: install cargo-semver-checks correctly when skip_semver_checks is false#9

Merged
ThetaSinner merged 1 commit into
mainfrom
fix/semver-checks-install-conditional
Apr 8, 2026
Merged

fix: install cargo-semver-checks correctly when skip_semver_checks is false#9
ThetaSinner merged 1 commit into
mainfrom
fix/semver-checks-install-conditional

Conversation

@synchwire

@synchwire synchwire commented Apr 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

The conditional added in ae50ddb to skip the `Install cargo-semver-checks` step when semver checks are disabled was:

```yaml
if: ${{ inputs.skip_semver_checks == 'false' }}
```

`inputs.skip_semver_checks` is declared `type: boolean` on the `workflow_call` inputs, so the value flowing in is a JS-style boolean, not a string. GitHub Actions expression syntax coerces a boolean to a number for `==` comparisons (false → 0, true → 1) and parses the string operand as a number (`'false'` → `NaN`). Both `0 == NaN` and `1 == NaN` evaluate to false, so the conditional is always false regardless of what the caller passes.

Net effect on `v1.7.0`: the install step is always skipped, the next step (`Prepare release`) invokes `holochain_release_util prepare`, that runs `cargo semver-checks`, and cargo dies with `no such command: 'semver-checks'`. Reproduced as a real CI failure at holochain/holochain-wasmer Actions run #24160654985.

Fix

Evaluate the boolean directly instead of comparing it to a string:

```yaml
if: ${{ !inputs.skip_semver_checks }}
```

This installs the tool when `skip_semver_checks` is false (the default) and skips the install when it's true — which is what ae50ddb's commit message said it intended to do.

Test plan

  • YAML syntax validates
  • Diff is one line, behaviour-preserving for the intended case (`skip_semver_checks: true`) and bug-fixing for the default case (`skip_semver_checks: false` / unset)
  • Once tagged (presumably v1.7.1), holochain/holochain-wasmer#185 will bump to the new tag and re-run `Prepare a release` end-to-end

Summary by CodeRabbit

  • Chores
    • Updated release preparation workflow to correctly evaluate conditional logic for dependency checking configuration.

… false

The conditional added in ae50ddb to skip the install when semver
checks are disabled was

    if: ${{ inputs.skip_semver_checks == 'false' }}

`inputs.skip_semver_checks` is declared `type: boolean` on the
workflow_call inputs, so the value flowing in is a JS-style boolean,
not a string. In GitHub Actions expression syntax, comparing a
boolean to a string with `==` coerces the boolean to a number
(false → 0, true → 1) and parses the string as a number (`'false'`
→ NaN). Both `0 == NaN` and `1 == NaN` evaluate to false, so the
conditional is *always* false regardless of what the caller passes
— meaning the install step is always skipped. The next step
(`Prepare release`) then explodes when `holochain_release_util
prepare` invokes `cargo semver-checks` and the binary isn't on
PATH.

The minimal fix is to evaluate the boolean directly:

    if: ${{ !inputs.skip_semver_checks }}

This installs the tool when `skip_semver_checks` is false (the
default) and skips the install when it's true, which matches the
intent of the original commit message.

Tested by inspection of the GitHub Actions expression docs on
loose-equality coercion. Reproduced as a CI failure on
holochain/holochain-wasmer at
https://github.com/holochain/holochain-wasmer/actions/runs/24160654985/job/70510871869
where the prepare run on v1.7.0 dies with `cargo semver-checks
command failed with status: exit status: 101` and the underlying
"no such command: 'semver-checks'" error from cargo.
@cocogitto-bot

cocogitto-bot Bot commented Apr 8, 2026

Copy link
Copy Markdown

✔️ 8076a5c - Conventional commits check succeeded.

@coderabbitai

coderabbitai Bot commented Apr 8, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: dfa51849-cdb2-4bc6-8d25-c092c150c18f

📥 Commits

Reviewing files that changed from the base of the PR and between 08bed4a and 8076a5c.

📒 Files selected for processing (1)
  • .github/workflows/prepare-release.yml

Walkthrough

Modified the GitHub Actions workflow to use direct boolean evaluation instead of string comparison for the skip_semver_checks input, aligning the conditional check with its boolean type.

Changes

Cohort / File(s) Summary
GitHub Actions Workflow
.github/workflows/prepare-release.yml
Updated the "Install cargo-semver-checks" step conditional from string comparison ('false') to direct truthiness check (!inputs.skip_semver_checks), ensuring proper boolean type handling.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main fix: correcting the conditional logic for the cargo-semver-checks installation when skip_semver_checks is false.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/semver-checks-install-conditional

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ThetaSinner ThetaSinner merged commit eddc4ae into main Apr 8, 2026
4 checks passed
@ThetaSinner ThetaSinner deleted the fix/semver-checks-install-conditional branch April 8, 2026 22:29
synchwire added a commit to holochain/holochain-wasmer that referenced this pull request Apr 8, 2026
Picks up holochain/actions#9, which fixes the broken
`if: ${{ inputs.skip_semver_checks == 'false' }}` conditional on
the cargo-semver-checks install step. v1.7.0 had that conditional
always evaluating false (boolean compared to a string in GitHub
Actions expression syntax), so the install step was always skipped
and the prepare step then died with `no such command:
'semver-checks'`. v1.8.0 evaluates the boolean directly.

The setup_script hook from #8 (which downloads LLVM for the
`wasmer-sys-llvm` semver check) is unchanged and still wired up
in this workflow file.
ThetaSinner pushed a commit to holochain/holochain-wasmer that referenced this pull request Apr 8, 2026
Picks up holochain/actions#9, which fixes the broken
`if: ${{ inputs.skip_semver_checks == 'false' }}` conditional on
the cargo-semver-checks install step. v1.7.0 had that conditional
always evaluating false (boolean compared to a string in GitHub
Actions expression syntax), so the install step was always skipped
and the prepare step then died with `no such command:
'semver-checks'`. v1.8.0 evaluates the boolean directly.

The setup_script hook from #8 (which downloads LLVM for the
`wasmer-sys-llvm` semver check) is unchanged and still wired up
in this workflow file.
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.

2 participants