Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.
Python aicode-complexitycode-healthcode-intelligencecode-qualitydead-codedeveloper-toolsdocumentationgit-analyticsmcpopen-sourcepythonrefactoringstatic-analysistechnical-debt
ci: make the internal prerelease publish idempotent (#1494)
Raghav Chamadiya6d5e5178cf56
diff --git a/.github/workflows/publish-internal.yml b/.github/workflows/publish-internal.ymlindex b5e5b6f1b..c3b540040 100644--- a/.github/workflows/publish-internal.yml+++ b/.github/workflows/publish-internal.yml@@ -11,10 +11,16 @@ name: Publish internal prereleases# (`publish.yml`) only fires on `v*` tags and is unaffected.## Triggers:-# - push to `next` (auto)+# - push to `main` (auto), so a merged PR publishes itself# - workflow_dispatch (manual, for re-publishes)#-# Triggers on push to `main` so merged PRs automatically publish.+# Publishing is idempotent. The version is derived from the commit SHA, so+# republishing one is by definition a no-op, and each step skips when the+# version is already on the registry. Without that, anything that delivers a+# second push event for a SHA already published (a duplicate webhook, a re-run,+# a manual dispatch on an already-built commit) turns main red on a 409 with+# nothing actually wrong. `cancel-in-progress` is deliberately not the fix: it+# would kill a real publish mid-flight when the next merge lands.on:push:@@ -70,7 +76,11 @@ jobs:run: |npm pkg set version="$VERSION"npm pkg delete private- npm publish+ if npm view "@repowise-dev/types@$VERSION" version >/dev/null 2>&1; then+ echo "@repowise-dev/types@$VERSION is already published, skipping"+ else+ npm publish+ fi- name: Publish @repowise-dev/uiworking-directory: packages/ui@@ -81,12 +91,16 @@ jobs:npm pkg set version="$VERSION"npm pkg set dependencies.@repowise-dev/types="$VERSION"npm pkg delete private- npm publish+ if npm view "@repowise-dev/ui@$VERSION" version >/dev/null 2>&1; then+ echo "@repowise-dev/ui@$VERSION is already published, skipping"+ else+ npm publish+ fi- name: Summaryrun: |{- echo "### Published"+ echo "### Available on GitHub Packages"echo ""echo "- \`@repowise-dev/types@${{ steps.ver.outputs.version }}\`"echo "- \`@repowise-dev/ui@${{ steps.ver.outputs.version }}\`"