Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions scripts/create-release-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,18 @@ main() {
if [[ -f package-lock.json ]] && ! git diff --staged --quiet package-lock.json 2>/dev/null; then
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conditional that decides whether to git add package-lock.json is checking the staged diff (git diff --staged --quiet package-lock.json). At this point the lockfile hasn’t been staged yet, so this will typically report “no staged changes” and skip adding the lockfile even when npm version modified it. Use a working-tree/index check (e.g., git diff --quiet -- package-lock.json or git status --porcelain -- package-lock.json) so changed lockfiles are reliably included in the release commit.

Suggested change
if [[ -f package-lock.json ]] && ! git diff --staged --quiet package-lock.json 2>/dev/null; then
if [[ -f package-lock.json ]] && ! git diff --quiet -- package-lock.json 2>/dev/null; then

Copilot uses AI. Check for mistakes.
git add package-lock.json
fi
git commit -m "chore: bump package version to ${new_version}"
fi

# Generate changelog if enabled
if [[ "$INPUT_CHANGELOG" == "true" ]]; then
echo "Generating changelog..."
update_changelog "$new_version" "$last_tag"
git add CHANGELOG.md
git commit -m "chore: update changelog for ${INPUT_VERSION_PREFIX}${new_version}"
fi

# Commit all release changes together
if ! git diff --staged --quiet 2>/dev/null; then
git commit -m "chore: release ${INPUT_VERSION_PREFIX}${new_version}"
fi

# Push the branch
Expand Down