Skip to content

Commit 64ce590

Browse files
lawrence-u10dclaude
andcommitted
fix: shellcheck SC2016 - pass PACKAGE_COUNT as awk variable
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 38c50a2 commit 64ce590

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

scripts/renovate-security-bump.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ detect_changed_packages() {
194194
PACKAGE_NAME=$(echo "$CHANGED_PACKAGES" | head -1 | cut -d'=' -f1)
195195
CHANGELOG_ENTRY="- **Security update**: Updated \`${PACKAGE_NAME}\` to address security vulnerability"
196196
elif [ "$PACKAGE_COUNT" -le 3 ]; then
197-
PACKAGE_NAMES=$(echo "$CHANGED_PACKAGES" | cut -d'=' -f1 | paste -sd, - | sed 's/,/, /g' | sed 's/\([^,]*\)/`\1`/g')
197+
# Wrap each package in backticks, then join with commas
198+
PACKAGE_NAMES=$(echo "$CHANGED_PACKAGES" | cut -d'=' -f1 | awk -v count="$PACKAGE_COUNT" '{printf "`%s`", $0; if (NR < count) printf ", "}')
198199
CHANGELOG_ENTRY="- **Security update**: Updated ${PACKAGE_NAMES} to address security vulnerabilities"
199200
else
200201
CHANGELOG_ENTRY="- **Security update**: Updated ${PACKAGE_COUNT} dependencies to address security vulnerabilities"
@@ -276,7 +277,11 @@ update_changelog() {
276277
dev_header = use_brackets == "true" ? "## [" dev_version "]" : "## " dev_version
277278
release_header = use_brackets == "true" ? "## [" release_version "]" : "## " release_version
278279
279-
if (index($0, dev_header) == 1) {
280+
# Exact match: strip trailing whitespace and compare
281+
line_trimmed = $0
282+
gsub(/[[:space:]]+$/, "", line_trimmed)
283+
284+
if (line_trimmed == dev_header) {
280285
print release_header
281286
in_target_version = 1
282287
next

0 commit comments

Comments
 (0)