Conversation
📝 WalkthroughWalkthroughConsolidates the release flow into a single Changes
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub Actions
participant RI as release-it (npx)
participant CH as changelog.sh / git-cliff
participant Git as Git Remote (origin)
participant GH_API as GitHub API
participant NPM as npm Registry
GH->>RI: invoke npx release-it (inputs: increment, pre_release, dry_run, GITHUB_TOKEN)
RI->>CH: run ./changelog.sh (after:bump) to generate notes
CH->>Git: read tags & commits (git-cliff) and output changelog
RI->>Git: create commit & tag
RI->>Git: push commits & tags to origin
RI->>GH_API: create GitHub Release (uses GITHUB_TOKEN)
RI->>NPM: publish package (uses npm auth env)
GH_API-->>GH: release created
NPM-->>GH: publish result
Git-->>GH: push result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/uniwind/.release-it.json (1)
7-8: Consider keeping release safety checks enabled by default.Disabling these checks makes accidental dirty-tree or misconfigured publish runs easier, especially outside CI.
♻️ Safer default config
- "requireCleanWorkingDir": false, - "requireUpstream": false, + "requireCleanWorkingDir": true, + "requireUpstream": true, ... - "skipChecks": true + "skipChecks": falseAlso applies to: 23-23
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/uniwind/.release-it.json` around lines 7 - 8, The config disables important release safety checks by setting requireCleanWorkingDir and requireUpstream to false; re-enable them by setting requireCleanWorkingDir: true and requireUpstream: true (or remove these overrides so the defaults apply) and, if CI needs to bypass them, use CI-specific overrides or environment-based flags instead of changing the repo-defaults; update the keys requireCleanWorkingDir and requireUpstream in .release-it.json accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/release.yaml:
- Around line 97-98: Remove the NODE_AUTH_TOKEN environment variable from the
release workflow so npm Trusted Publishing via OIDC can work; specifically
delete the NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} entry (leave
GITHUB_TOKEN in place for other GitHub API usage) so the release step (the job
that uses permissions: id-token: write and release-it/--provenance) will use
OIDC token-based auth instead of being forced to token-based auth with
GITHUB_TOKEN.
---
Nitpick comments:
In `@packages/uniwind/.release-it.json`:
- Around line 7-8: The config disables important release safety checks by
setting requireCleanWorkingDir and requireUpstream to false; re-enable them by
setting requireCleanWorkingDir: true and requireUpstream: true (or remove these
overrides so the defaults apply) and, if CI needs to bypass them, use
CI-specific overrides or environment-based flags instead of changing the
repo-defaults; update the keys requireCleanWorkingDir and requireUpstream in
.release-it.json accordingly.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (4)
.github/workflows/release.yamlpackages/uniwind/.release-it.jsonpackages/uniwind/CHANGELOG.mdpackages/uniwind/package.json
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/release.yaml (1)
85-95: Consider using an array for more robust argument handling.Using unquoted
$ARGScan cause incorrect argument parsing ifpre_releaseever contains spaces (though unlikely with typical identifiers like "beta", "rc"). A bash array would be more robust.♻️ Optional improvement using array-based approach
- ARGS="--ci $INCREMENT" + ARGS=(--ci "$INCREMENT") if [ -n "$PRE_RELEASE" ]; then - ARGS="$ARGS --preRelease=$PRE_RELEASE" + ARGS+=(--preRelease="$PRE_RELEASE") fi if [ "$DRY_RUN" = "true" ]; then - ARGS="$ARGS --dry-run" + ARGS+=(--dry-run) fi - npx release-it $ARGS + npx release-it "${ARGS[@]}"🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/release.yaml around lines 85 - 95, Replace the string ARGS with a bash array to avoid word-splitting: initialize an array (e.g., ARGS=(--ci "$INCREMENT")), append flags conditionally using ARGS+=(--preRelease="$PRE_RELEASE") and ARGS+=(--dry-run) when appropriate, and invoke release-it with npx release-it "${ARGS[@]}" so each flag/value is passed as a separate argument; update references to ARGS in the shown block accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/release.yaml:
- Around line 85-95: Replace the string ARGS with a bash array to avoid
word-splitting: initialize an array (e.g., ARGS=(--ci "$INCREMENT")), append
flags conditionally using ARGS+=(--preRelease="$PRE_RELEASE") and
ARGS+=(--dry-run) when appropriate, and invoke release-it with npx release-it
"${ARGS[@]}" so each flag/value is passed as a separate argument; update
references to ARGS in the shown block accordingly.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
packages/uniwind/changelog.sh (1)
4-12: Make the script path-stable instead of cwd-dependent.Lines 4, 8, and 12 resolve files relative to the caller's working directory. While the workflow currently mitigates this by setting
working-directory: packages/uniwindbefore invokingrelease-it, the script itself is fragile. Manual invocation from different directories would read/write files in the wrong locations.The proposed hardening using
SCRIPT_DIRandREPO_ROOTwould make the script robust to invocation context.♻️ Proposed hardening
#!/usr/bin/env bash set -euo pipefail -VERSION=$(node -p "require('./package.json').version") +SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(git -C "$SCRIPT_DIR" rev-parse --show-toplevel)" +VERSION="$(node -p "require(process.argv[1]).version" "$SCRIPT_DIR/package.json")" INCLUDE_PATH="packages/uniwind/**" +cd "$REPO_ROOT" + if [ "${1:-}" = "stdout" ]; then - npx git-cliff --config cliff.toml --include-path "$INCLUDE_PATH" \ + npx git-cliff --config "$SCRIPT_DIR/cliff.toml" --include-path "$INCLUDE_PATH" \ --unreleased --tag "$VERSION" --output - else - npx git-cliff --config cliff.toml --include-path "$INCLUDE_PATH" \ - --tag "$VERSION" --output CHANGELOG.md + npx git-cliff --config "$SCRIPT_DIR/cliff.toml" --include-path "$INCLUDE_PATH" \ + --tag "$VERSION" --output "$SCRIPT_DIR/CHANGELOG.md" fi🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/uniwind/changelog.sh` around lines 4 - 12, The script is cwd-dependent; make it path-stable by computing SCRIPT_DIR (e.g., dirname of "$0") and REPO_ROOT (one or two levels up) and use those when reading package.json and composing INCLUDE_PATH and output paths: change VERSION to read "$REPO_ROOT/package.json", set INCLUDE_PATH to "$REPO_ROOT/packages/uniwind/**", and pass resolved paths for --config and --output (use "$REPO_ROOT/cliff.toml" and write "$REPO_ROOT/packages/uniwind/CHANGELOG.md" when not stdout) so git-cliff always operates on repository-root–relative files regardless of caller cwd.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/uniwind/changelog.sh`:
- Around line 8-12: The git-cliff invocations pass the raw VERSION (e.g. 1.2.3)
to the --tag flag causing mismatched metadata; update both git-cliff calls in
changelog.sh (the two npx git-cliff lines) to pass the release tag prefixed with
v (i.e., use "v$VERSION" for --tag) so generated changelog metadata and compare
links match the repository's v${version} tags.
In `@packages/uniwind/cliff.toml`:
- Around line 67-68: Update the skip rule that currently reads "{ message =
"^chore\\(release\\)", skip = true }" so it also matches the "chore: release
v${version}" style commits; replace the regex with one that covers both forms
(for example use a single pattern like "^chore(?:\\(release\\)|: release)" or
equivalent) and keep skip = true so release commits are excluded from the
changelog.
---
Nitpick comments:
In `@packages/uniwind/changelog.sh`:
- Around line 4-12: The script is cwd-dependent; make it path-stable by
computing SCRIPT_DIR (e.g., dirname of "$0") and REPO_ROOT (one or two levels
up) and use those when reading package.json and composing INCLUDE_PATH and
output paths: change VERSION to read "$REPO_ROOT/package.json", set INCLUDE_PATH
to "$REPO_ROOT/packages/uniwind/**", and pass resolved paths for --config and
--output (use "$REPO_ROOT/cliff.toml" and write
"$REPO_ROOT/packages/uniwind/CHANGELOG.md" when not stdout) so git-cliff always
operates on repository-root–relative files regardless of caller cwd.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (4)
packages/uniwind/.release-it.jsonpackages/uniwind/changelog.shpackages/uniwind/cliff.tomlpackages/uniwind/package.json
🚧 Files skipped from review as they are similar to previous changes (1)
- packages/uniwind/package.json
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/uniwind/changelog.sh (1)
4-12: Script has a working-directory dependency, but it's currently mitigated by explicit pipeline configuration.The script relies on relative paths (
./package.json,cliff.toml,CHANGELOG.md) that depend on the caller's working directory. However, in the release workflow (release.yaml, line 79), the working directory is explicitly set topackages/uniwind, so the script works as expected in the current pipeline.That said, the design is fragile: if the working directory configuration changes, or if someone runs the script manually from elsewhere, it will fail. Additionally, line 5 uses a hardcoded repo-relative path (
INCLUDE_PATH="packages/uniwind/**") while the script executes from the package directory, creating an inconsistency.Anchoring paths to the script directory using
BASH_SOURCEwould make the script more robust and independent of caller context.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/uniwind/changelog.sh` around lines 4 - 12, The script relies on caller working directory (uses ./package.json, cliff.toml, CHANGELOG.md and hardcoded INCLUDE_PATH) which is fragile; update the script to compute its directory via BASH_SOURCE (e.g., SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)") and then reference files relative to that directory when resolving VERSION, cliff.toml, CHANGELOG.md and set INCLUDE_PATH relative to SCRIPT_DIR (or the repo root computed from SCRIPT_DIR) so the commands in the block that use VERSION and INCLUDE_PATH work regardless of the current working directory.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/uniwind/changelog.sh`:
- Around line 4-12: The script relies on caller working directory (uses
./package.json, cliff.toml, CHANGELOG.md and hardcoded INCLUDE_PATH) which is
fragile; update the script to compute its directory via BASH_SOURCE (e.g.,
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)") and then reference
files relative to that directory when resolving VERSION, cliff.toml,
CHANGELOG.md and set INCLUDE_PATH relative to SCRIPT_DIR (or the repo root
computed from SCRIPT_DIR) so the commands in the block that use VERSION and
INCLUDE_PATH work regardless of the current working directory.
|
🚀 This pull request is included in v1.5.0. See Release v1.5.0 for release notes. |
Summary by CodeRabbit