{"record":{"id":"91dbff5dfbbedffe","repo":"midudev/autoskills","slug":"no-se-pudo-eliminar-el-tag-v-newversion","errorCode":null,"errorMessage":"⚠️  No se pudo eliminar el tag v${newVersion}","messagePattern":"⚠️  No se pudo eliminar el tag v(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/autoskills/scripts/release.mjs","lineNumber":260,"sourceCode":"  : null;\nconst releaseStartHead = run(\"git rev-parse HEAD\", { cwd: REPO_ROOT });\n\nlet commitCreated = false;\nlet tagCreated = false;\n\n/**\n * Restores local repository/files to the state before the release attempt.\n * This keeps failed releases from leaving bumped versions, tags or commits behind.\n */\nfunction rollbackRelease() {\n  console.log(\"\\n↩️  Revirtiendo cambios locales de la release fallida...\");\n\n  if (tagCreated) {\n    try {\n      run(`git tag -d v${newVersion}`, { cwd: REPO_ROOT });\n      console.log(`✅ Tag v${newVersion} eliminado`);\n    } catch {\n      console.warn(`⚠️  No se pudo eliminar el tag v${newVersion}`);\n    }\n  }\n\n  if (commitCreated) {\n    try {\n      run(`git reset --hard ${releaseStartHead}`, { cwd: REPO_ROOT });\n      console.log(\"✅ Commit de release revertido\");\n      return;\n    } catch {\n      console.warn(\"⚠️  No se pudo revertir el commit de release automáticamente\");\n    }\n  }\n\n  // If no release commit was created, restore touched files directly.\n  try {\n    writeFileSync(PKG_PATH, originalPkgContent);\n\n    if (originalChangelogContent === null) {","sourceCodeStart":242,"sourceCodeEnd":278,"githubUrl":"https://github.com/midudev/autoskills/blob/0ec725320d2137253ab2e68e7ba8a072148e741a/packages/autoskills/scripts/release.mjs#L242-L278","documentation":"release.mjs rollbackRelease() tries to undo a partially applied release. When a tag v<newVersion> was created but the release later failed, it runs `git tag -d v<newVersion>`; if that git command fails, it only logs this warning and continues with the rest of the rollback. It is a best-effort cleanup notice, not a thrown exception.","triggerScenarios":"During rollbackRelease(), `git tag -d v<newVersion>` exits non-zero — e.g. the tag was already deleted, is protected on the remote, or git itself errored — while tagCreated is true.","commonSituations":"A release fails after tagging; the developer (or a parallel CI job) already deleted the tag manually; running the release script in an environment without proper git permissions or with a detached/odd git state.","solutions":["Delete the leftover tag manually: `git tag -d v<newVersion>` (and `git push origin :refs/tags/v<newVersion>` if it was pushed).","Check `git tag -l 'v<newVersion>'` to confirm whether the tag still exists before re-running anything.","Re-run the release script after the working tree is clean so rollback has a consistent state to operate on."],"exampleFix":"// before (manual shell after failed release)\ngit push --tags\n// after\ngit tag -d v1.2.3 && git push origin :refs/tags/v1.2.3","handlingStrategy":"try-catch","validationCode":"git tag -l \"v$VERSION\" | grep -q . && echo \"tag v$VERSION exists; rollback may warn\"","typeGuard":null,"tryCatchPattern":"try {\n  run(`git tag -d v${newVersion}`, { cwd: REPO_ROOT });\n} catch (err) {\n  console.warn(`⚠️  No se pudo eliminar el tag v${newVersion}: ${err.message}. Elimínalo manualmente si existe.`);\n}","preventionTips":["Before re-running a release, check `git tag -l v<version>` and remove stale tags.","Avoid running releases concurrently (CI concurrency group) so nothing deletes the tag mid-rollback.","Push tags only after the whole release succeeds to narrow the rollback window."],"tags":["git","release","rollback","tag","cleanup"],"backgroundTag":"git-command-failed","analyzedSha":"0ec725320d2137253ab2e68e7ba8a072148e741a","analyzedAt":"2026-09-15T14:12:31.090Z","contentChangedAt":"2026-09-15T14:12:31.090Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}