-
Notifications
You must be signed in to change notification settings - Fork 23
Skill to debug semantic release issues when successful publication fails #28
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
base: main
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| --- | ||
| name: semantic-release-troubleshooting | ||
| description: >- | ||
| Diagnose and fix semantic-release issues when a specific version is not being | ||
| released. Use when semantic-release skips a version, fails to release, or when | ||
| troubleshooting after git push --force, squashed commits, permission errors, | ||
| or reference already exists. | ||
| --- | ||
|
|
||
| # semantic-release Troubleshooting | ||
|
|
||
| When a specific version is not being released, follow this diagnostic workflow. | ||
|
|
||
| ## 1. Identify the Problem | ||
|
|
||
| Determine which scenario matches: | ||
|
|
||
| | Symptom | Section | | ||
| |---------|---------| | ||
| | `You do not have permission to publish` (403) | → [Permission error](#permission-error) | | ||
| | Release skipped; commits not counted | → [Squashed commits](#squashed-commits) | | ||
| | `reference already exists` when pushing tag | → [Tag conflict](#tag-conflict) | | ||
| | Release not found after `git push --force` | → [History rewrite recovery](#history-rewrite-recovery) | | ||
|
|
||
| ## 2. Permission Error | ||
|
|
||
| **Cause:** npm registry auth or package name/ownership issues. | ||
|
|
||
| **Verify package availability:** | ||
| ```bash | ||
| npm install --global npm-name-cli | ||
| npm-name <package-name> | ||
| ``` | ||
|
|
||
| **Fix:** Update `package.json` if name is taken, or use an [npm scope](https://docs.npmjs.com/misc/scope). Check [npm registry authentication](https://github.com/semantic-release/npm#npm-registry-authentication) and user [publish permissions](https://docs.npmjs.com/cli/team). | ||
|
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. 🧩 Analysis chain🌐 Web query: `Are these npm documentation URLs still valid:
💡 Result: No, none of the provided URLs are currently valid. 1. https://docs.npmjs.com/misc/scope - Invalid. The current npm documentation for scopes is at https://docs.npmjs.com/cli/v11/using-npm/scope/ or https://docs.npmjs.com/about-scopes/. The /misc/ path no longer exists. 2. https://github.com/semantic-release/npm#npm-registry-authentication - Valid. The repository exists at https://github.com/semantic-release/npm, and the README contains a section titled "npm registry authentication". 3. https://docs.npmjs.com/cli/team - Invalid. The current npm documentation for the team command is at https://docs.npmjs.com/cli/v8/commands/npm-team/ (legacy v8 docs). No /cli/team path exists in current docs. Citations:
Update two broken npm documentation links. The scope link ( 🤖 Prompt for AI Agents |
||
|
|
||
| ## 3. Squashed Commits | ||
|
|
||
| **Cause:** semantic-release uses [commit message convention](https://github.com/semantic-release/semantic-release#commit-message-format). Squashed commits often get non-compliant messages and are ignored. | ||
|
|
||
| **Fix:** Rewrite the squashed commit message to follow the convention (e.g. `feat:`, `fix:`, `fix!:`, `BREAKING CHANGE:`). One squashed commit = one logical change; avoid combining unrelated features. | ||
|
|
||
| ## 4. Tag Conflict (`reference already exists`) | ||
|
|
||
| **Cause:** A tag with the target version exists but is not in the current branch's history. | ||
|
|
||
| **Diagnose:** | ||
| ```bash | ||
| # Does the tag exist? | ||
| git rev-list -1 <tag name> | ||
|
|
||
| # Which branches contain this tag? | ||
| git branch --contains <tag name> | ||
| ``` | ||
|
|
||
| **If the release was published:** Merge the commits from that release into your release branch. | ||
|
|
||
| **If no published release:** Delete the tag: | ||
| ```bash | ||
| git tag -d <tag name> | ||
| git push origin :refs/tags/<tag name> | ||
| ``` | ||
|
|
||
| ## 5. History Rewrite Recovery (after `git push --force`) | ||
|
|
||
| **Cause:** `git push --force` rewrites history; tags and git notes tied to old commits become invalid. | ||
|
|
||
| **Recovery steps** (in order): | ||
|
|
||
| 1. **Delete the orphaned tags** (remote then local): | ||
| ```bash | ||
| git push origin -d :<TAG NAME> # e.g. git push origin -d :v2.0.0-beta.1 | ||
| git tag -d <TAG NAME> | ||
| ``` | ||
|
Comment on lines
+70
to
+74
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Verify git push syntax for deleting remote tags
git push --help | grep -A 5 "delete refs"Repository: patternfly/ai-helpers Length of output: 162 🏁 Script executed: #!/bin/bash
# Check if the file exists and view the content around lines 70-74
if [ -f ".cursor/skills/semantic-release-troubleshooting/SKILL.md" ]; then
echo "File found. Content around lines 70-74:"
sed -n '65,80p' ".cursor/skills/semantic-release-troubleshooting/SKILL.md"
else
echo "File not found. Searching for similar files..."
find . -name "SKILL.md" -o -name "*semantic-release*" 2>/dev/null | head -20
fiRepository: patternfly/ai-helpers Length of output: 556 🌐 Web query:
💡 Result: To delete a remote Git tag using git push, there are two primary syntaxes: 1. Modern syntax (Git 1.8+): git push origin --delete or git push origin -d 2. Colon prefix syntax (older/precise): git push origin :refs/tags/ The colon syntax pushes an empty source reference (before the colon) to the destination refs/tags/, effectively deleting it on the remote. Use refs/tags/ prefix to avoid ambiguity if a branch with the same name exists. Optionally delete locally first: git tag -d Examples: git push origin --delete v1.0 # or git push origin :refs/tags/v1.0 The --delete flag is equivalent to prefixing with colon and is more intuitive. Both are supported in current Git versions (up to 2.53+ as of 2026). Citations:
Fix incorrect git push syntax for deleting remote tags. Line 72 contains
Proposed fix- git push origin -d :<TAG NAME> # e.g. git push origin -d :v2.0.0-beta.1
+ git push origin -d <TAG NAME> # e.g. git push origin -d v2.0.0-beta.1
git tag -d <TAG NAME>🤖 Prompt for AI Agents |
||
|
|
||
| 2. **Re-create the tags** on the new commit: | ||
| ```bash | ||
| git tag <TAG NAME> <COMMIT HASH> # e.g. git tag v2.0.0-beta.1 abcdef0 | ||
| ``` | ||
|
|
||
| 3. **Re-create git notes** for each tag: | ||
| ```bash | ||
| # Beta/pre-release channel only | ||
| git notes --ref semantic-release add -f -m '{"channels":["beta"]}' <TAG NAME> | ||
|
|
||
| # Also on default channel (master/main) | ||
| git notes --ref semantic-release add -f -m '{"channels":[null,"beta"]}' <TAG NAME> | ||
| ``` | ||
|
|
||
| 4. **Push the notes** (force required after rebase): | ||
| ```bash | ||
| git push --force origin refs/notes/semantic-release | ||
| ``` | ||
|
|
||
| ## Reference | ||
|
|
||
| Full documentation: [semantic-release Troubleshooting](https://semantic-release.gitbook.io/semantic-release/support/troubleshooting) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skills need to live under
plugins/<plugin-name>/skills/—.cursor/skills/isn't the right location. This is repo/release tooling, soplugins/pf-workflow/skills/semantic-release-troubleshooting/would be the right home.