Skip to content

Commit f6b5e8d

Browse files
fix(ci): restore version bump logic for unpublished versions (#16)
1 parent bc4d801 commit f6b5e8d

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

.github/workflows/publish-npm.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,22 +63,22 @@ jobs:
6363
- name: Prepare release version
6464
id: release
6565
run: |
66-
if [ "${{ steps.npm.outputs.published }}" = "true" ]; then
66+
head_subject="$(git log -1 --pretty=%s)"
67+
68+
if [ "${{ steps.npm.outputs.published }}" = "true" ] && [[ "$head_subject" == chore\(release\):* ]]; then
6769
echo "should_publish=false" >> "$GITHUB_OUTPUT"
6870
echo "version=${{ steps.pkg.outputs.version }}" >> "$GITHUB_OUTPUT"
6971
exit 0
7072
fi
7173
72-
head_subject="$(git log -1 --pretty=%s)"
73-
if [[ "$head_subject" == chore\(release\):* ]]; then
74-
echo "should_publish=false" >> "$GITHUB_OUTPUT"
75-
echo "version=${{ steps.pkg.outputs.version }}" >> "$GITHUB_OUTPUT"
76-
exit 0
74+
if [ "${{ steps.npm.outputs.published }}" = "true" ]; then
75+
npm version patch --no-git-tag-version
76+
pnpm install --lockfile-only
77+
echo "needs_commit=true" >> "$GITHUB_OUTPUT"
78+
else
79+
echo "needs_commit=false" >> "$GITHUB_OUTPUT"
7780
fi
7881
79-
npm version patch --no-git-tag-version
80-
pnpm install --lockfile-only
81-
echo "needs_commit=true" >> "$GITHUB_OUTPUT"
8282
echo "should_publish=true" >> "$GITHUB_OUTPUT"
8383
echo "version=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT"
8484

0 commit comments

Comments
 (0)