Skip to content

Commit d25b8f2

Browse files
committed
ci: fix grep exit code handling in version script
1 parent 47d5bb8 commit d25b8f2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/publish.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ jobs:
3030
MONTH=$(date +%-m)
3131
YEAR_MONTH="${YEAR}.${MONTH}"
3232
VERSIONS=$(npm view claude-setting-manager versions --json 2>/dev/null || echo "[]")
33-
PATCH=$(echo "$VERSIONS" | grep -c "\"${YEAR_MONTH}\." || echo "0")
33+
PATCH=$(echo "$VERSIONS" | grep -c "\"${YEAR_MONTH}\." || true)
34+
PATCH=${PATCH:-0}
3435
VERSION="${YEAR_MONTH}.${PATCH}"
35-
echo "version=$VERSION" >> $GITHUB_OUTPUT
3636
echo "Publishing version: $VERSION"
37+
echo "version=$VERSION" >> $GITHUB_OUTPUT
3738
3839
- name: Update package.json version
3940
run: npm version ${{ steps.version.outputs.version }} --no-git-tag-version --allow-same-version

0 commit comments

Comments
 (0)