Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:

- name: Build packages
run: pnpm build

- name: Validate shadcn registry
run: pnpm dlx shadcn@latest registry validate
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
notify:
name: Slack Notification
needs: [ci]
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/publish-public-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,23 @@ jobs:
echo "Created tag: $TAG_NAME"
done

# Unified version tag for GitHub Registry consumers (npx shadcn add org/repo/item#v2.1.0)
UNIFIED_TAG="v${VERSION}"

if git rev-parse "$UNIFIED_TAG" >/dev/null 2>&1; then
echo "Tag $UNIFIED_TAG exists locally, deleting..."
git tag -d "$UNIFIED_TAG"
fi

if git ls-remote --tags origin | grep -q "refs/tags/$UNIFIED_TAG"; then
echo "Tag $UNIFIED_TAG exists remotely, deleting..."
git push origin ":refs/tags/$UNIFIED_TAG" || true
fi

git tag -a "$UNIFIED_TAG" -m "Release v${VERSION} — GitHub Registry ref"
git push origin "$UNIFIED_TAG"
Comment on lines +311 to +322

@coderabbitai coderabbitai Bot Jul 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep GitHub Registry version tags immutable.

Deleting and recreating v${VERSION} can make the same installation ref resolve to different source. Fail if the release tag already exists instead of moving it.

Proposed fix
-          if git rev-parse "$UNIFIED_TAG" >/dev/null 2>&1; then
-            echo "Tag $UNIFIED_TAG exists locally, deleting..."
-            git tag -d "$UNIFIED_TAG"
-          fi
-
-          if git ls-remote --tags origin | grep -q "refs/tags/$UNIFIED_TAG"; then
-            echo "Tag $UNIFIED_TAG exists remotely, deleting..."
-            git push origin ":refs/tags/$UNIFIED_TAG" || true
+          if git rev-parse "$UNIFIED_TAG" >/dev/null 2>&1 ||
+             git ls-remote --exit-code --tags origin "refs/tags/$UNIFIED_TAG" >/dev/null 2>&1; then
+            echo "::error::Release tag $UNIFIED_TAG already exists; refusing to move it."
+            exit 1
           fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if git rev-parse "$UNIFIED_TAG" >/dev/null 2>&1; then
echo "Tag $UNIFIED_TAG exists locally, deleting..."
git tag -d "$UNIFIED_TAG"
fi
if git ls-remote --tags origin | grep -q "refs/tags/$UNIFIED_TAG"; then
echo "Tag $UNIFIED_TAG exists remotely, deleting..."
git push origin ":refs/tags/$UNIFIED_TAG" || true
fi
git tag -a "$UNIFIED_TAG" -m "Release v${VERSION} — GitHub Registry ref"
git push origin "$UNIFIED_TAG"
if git rev-parse "$UNIFIED_TAG" >/dev/null 2>&1 ||
git ls-remote --exit-code --tags origin "refs/tags/$UNIFIED_TAG" >/dev/null 2>&1; then
echo "::error::Release tag $UNIFIED_TAG already exists; refusing to move it."
exit 1
fi
git tag -a "$UNIFIED_TAG" -m "Release v${VERSION} — GitHub Registry ref"
git push origin "$UNIFIED_TAG"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/publish-public-npm.yml around lines 311 - 322, Update the
release-tag flow around UNIFIED_TAG to preserve tag immutability: remove the
local and remote deletion logic, check whether the tag already exists remotely,
and fail the workflow before creating or pushing it. Continue creating and
pushing the tag only when it does not already exist.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional design — the delete-and-recreate behavior is needed because our publish workflow can be re-run on failure (e.g. partial npm publish). If the tag were immutable, a retry after a transient failure would require manual tag cleanup before the workflow could succeed. Since the tag always points to the same commit within a single workflow run, consumers installing by tag still get deterministic resolution for any given release.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description image shows a dark terminal running:

npx shadcn add auth0/auth0-ui-components/react/my-account/user-mfa-management#feat/github-registry-hybrid

It installs shadcn@4.13.0, reports successful registry and dependency checks, confirms overwriting button.tsx and utils.ts, and lists “Created 60 files”, including src/components/auth/my-account/user-mfa-management.tsx and multiple MFA-related components.

@harishsundar-okta, thanks for clarifying the retry requirement. I agree that avoiding manual cleanup after a failed release is valuable.

However, a rerun is not necessarily the same workflow run or the same commit: workflow_dispatch may be invoked from a different ref, while retaining the same package version. The current delete-and-recreate flow would then move v${VERSION}, so consumers using that tag could receive different registry content over time.

The finding therefore still applies as an intentional tradeoff rather than an accidental behavior. If mutable tags are the accepted release policy, no change is needed here; documenting that policy near this block would help make the consumer-facing contract explicit.


✏️ Learnings added
Learnt from: harishsundar-okta
Repo: auth0/auth0-ui-components PR: 409
File: .github/workflows/publish-public-npm.yml:311-322
Timestamp: 2026-07-27T10:26:18.285Z
Learning: In `.github/workflows/publish-public-npm.yml`, the unified `v${VERSION}` Git tag is intentionally deleted and recreated to support rerunning a failed public NPM publish workflow without manual tag cleanup. This intentionally trades release-tag immutability for retry convenience.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

echo "Created unified tag: $UNIFIED_TAG"

- name: Create GitHub Release for Core
if: github.event.inputs.dry_run != 'true'
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2
Expand Down
3 changes: 3 additions & 0 deletions docs-site/api/r.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ function sendJson(res: VercelResponse, content: string): void {
res.setHeader('Content-Type', 'application/json');
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Cache-Control', 'public, max-age=3600');
res.setHeader('Deprecation', 'true');
res.setHeader('Sunset', 'Sat, 31 Dec 2026 23:59:59 GMT');
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
res.setHeader('Link', '<https://github.com/auth0/auth0-ui-components>; rel="successor-version"');
res.send(content);
}

Expand Down
Loading
Loading