-
Notifications
You must be signed in to change notification settings - Fork 7
feat: add github registry support #409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
4d764c7
af01197
7c11f50
4959265
6cf4c98
05adf97
fa51b99
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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
Suggested change
🤖 Prompt for AI Agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PR description image shows a dark terminal running:
It installs
However, a rerun is not necessarily the same workflow run or the same commit: 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
|
||||||||||||||||||||||||||||||||||||||||||
| 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 | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.