Skip to content

Commit 3069937

Browse files
ci(sdk): allow same-version publish by skipping version bump when tag matches
1 parent 83761a7 commit 3069937

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/sdk-publish.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,16 @@ jobs:
3232
- name: Install dependencies
3333
run: npm ci
3434

35-
- name: Set package version from tag
35+
- name: Set package version from tag (skip if same)
3636
run: |
3737
VERSION="${GITHUB_REF_NAME#sdk-v}"
38-
echo "Version from tag: $VERSION"
39-
npm version "$VERSION" --no-git-tag-version
38+
CURRENT=$(node -p "require('./package.json').version")
39+
echo "Version from tag: $VERSION (current: $CURRENT)"
40+
if [ "$CURRENT" != "$VERSION" ]; then
41+
npm version "$VERSION" --no-git-tag-version
42+
else
43+
echo "Version unchanged; skipping bump"
44+
fi
4045
4146
- name: Build
4247
run: npm run build

0 commit comments

Comments
 (0)