chore(release): v0.3.1#10
Conversation
- Add 'Release vX.Y.Z' run-name to the release workflow so manual dispatches and tag pushes are easy to tell apart in the Actions list. - Add CHANGELOG entry.
There was a problem hiding this comment.
🧪 PR Review is completed: Version bump to 0.3.1 plus a new dynamic run-name for the release workflow. The run-name expression has a logic bug where the 'manual' fallback is unreachable when inputs.version is empty.
Skipped files
CHANGELOG.md: Skipped file pattern
| # either "Release v<inputs.version>" (when supplied) or "Release manual". | ||
| # `run-name` only sees github.* and inputs.* — package.json can't be read here, | ||
| # so the dispatch flow relies on the `version` input to show the tag. | ||
| run-name: "Release ${{ github.event_name == 'push' && github.ref_name || format('v{0}', inputs.version) || 'manual' }}" |
There was a problem hiding this comment.
🟠 Logic Error
Issue: The run-name expression's || 'manual' fallback is unreachable. When inputs.version is empty (not supplied on manual dispatch), format('v{0}', inputs.version) evaluates to "v" — a non-empty, truthy string. This means the || 'manual' branch never fires, and the run name will display "Release v" instead of the intended "Release manual".
Fix: Guard the format() call with a truthiness check on inputs.version so that an empty input falls through to the 'manual' fallback.
Impact: Ensures the workflow run name is correct and meaningful for manual dispatches without a version input.
| run-name: "Release ${{ github.event_name == 'push' && github.ref_name || format('v{0}', inputs.version) || 'manual' }}" | |
| run-name: "Release ${{ github.event_name == 'push' && github.ref_name || (inputs.version && format('v{0}', inputs.version)) || 'manual' }}" |
Drop the manual 'git tag && git push tag' step from the release flow.
When a release/vX.Y.Z branch is merged into main, this workflow now:
1. Verifies the branch version matches package.json.
2. Publishes to npm (skipped if the version is already live).
3. Creates the vX.Y.Z GitHub release (which pushes the tag as a
side effect; the subsequent tag-triggered run is short-circuited
by the 'already on npm' check, so there is no loop).
The tag-push and workflow_dispatch triggers are kept as escape hatches.
|
✅ Reviewed the changes: Reviewed .github/workflows/release.yml: The release workflow changes are well-structured — the run-name expression, job if-condition, and version resolution logic for all three trigger paths (tag push, PR merge, manual dispatch) are correct. No new issues found. |
Bump version to 0.3.1, give the release workflow a 'Release vX.Y.Z' run-name, and make merging a release/vX.Y.Z PR into main auto-publish to npm + create the GitHub Release. No more 'git tag && git push tag' step.
What you do now: open a PR from release/vX.Y.Z and merge it. The workflow:
Triggers kept: tag pushes to main and manual workflow_dispatch still work as escape hatches / re-publish paths.
Triggers ignored: PR pushes to a release/v* branch, force-pushes, and merges of any other branch (enforced by the job-level
if).