Skip to content

Commit c73649a

Browse files
committed
Handle SDK already-published gracefully in build workflow
1 parent c5eee17 commit c73649a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/build.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,15 @@ jobs:
405405
- name: Publish to GitHub Packages
406406
if: steps.sdk-changes.outputs.changed == 'true'
407407
working-directory: sdk
408-
run: npm publish
408+
run: |
409+
npm publish 2>&1 | tee publish.log || {
410+
if grep -q "Cannot publish over existing version" publish.log; then
411+
echo "Version already published by sdk-release workflow, skipping"
412+
else
413+
cat publish.log
414+
exit 1
415+
fi
416+
}
409417
env:
410418
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
411419

0 commit comments

Comments
 (0)