Skip to content

Commit a65f85c

Browse files
authored
Merge pull request #32 from FoundatioFx/fix/unique-ci-package-version
Skip duplicate GitHub package publishes
2 parents b053976 + 6c579e0 commit a65f85c

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,12 @@ jobs:
110110

111111
- name: Push GitHub CI Packages
112112
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
113-
run: npm publish fetchclient.tgz --tag ${{ startsWith(github.ref, 'refs/tags/v') && 'latest' || 'next' }} --access public
113+
run: |
114+
package="@foundatiofx/fetchclient@${{ needs.lint.outputs.version }}"
115+
if npm view "$package" version --registry https://npm.pkg.github.com > /dev/null 2>&1; then
116+
echo "$package already exists in GitHub Packages; skipping publish."
117+
else
118+
npm publish fetchclient.tgz --tag ${{ startsWith(github.ref, 'refs/tags/v') && 'latest' || 'next' }} --access public
119+
fi
114120
env:
115121
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)