midudev/autoskills · warning

⚠️ No se pudo eliminar el tag v

Error message

⚠️  No se pudo eliminar el tag v${newVersion}

What it means

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.

Solutions

  1. Delete the leftover tag manually: `git tag -d v<newVersion>` (and `git push origin :refs/tags/v<newVersion>` if it was pushed).
  2. Check `git tag -l 'v<newVersion>'` to confirm whether the tag still exists before re-running anything.
  3. Re-run the release script after the working tree is clean so rollback has a consistent state to operate on.

Example fix

// before (manual shell after failed release)
git push --tags
// after
git tag -d v1.2.3 && git push origin :refs/tags/v1.2.3
Defensive patterns

Strategy: try-catch

Validate before calling

git tag -l "v$VERSION" | grep -q . && echo "tag v$VERSION exists; rollback may warn"

Try / catch

try {
  run(`git tag -d v${newVersion}`, { cwd: REPO_ROOT });
} catch (err) {
  console.warn(`⚠️  No se pudo eliminar el tag v${newVersion}: ${err.message}. Elimínalo manualmente si existe.`);
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "git command failed": what it means when a tool shells out to git and git exits non-zero — this error's family across 21 libraries.

Related errors


AI-assisted analysis of midudev/autoskills@0ec725320d (2026-09-15). Data as JSON: /api/errors/91dbff5dfbbedffe. Report an issue: GitHub.

Appendix: source

Thrown at packages/autoskills/scripts/release.mjs:260

  : null;
const releaseStartHead = run("git rev-parse HEAD", { cwd: REPO_ROOT });

let commitCreated = false;
let tagCreated = false;

/**
 * Restores local repository/files to the state before the release attempt.
 * This keeps failed releases from leaving bumped versions, tags or commits behind.
 */
function rollbackRelease() {
  console.log("\n↩️  Revirtiendo cambios locales de la release fallida...");

  if (tagCreated) {
    try {
      run(`git tag -d v${newVersion}`, { cwd: REPO_ROOT });
      console.log(`✅ Tag v${newVersion} eliminado`);
    } catch {
      console.warn(`⚠️  No se pudo eliminar el tag v${newVersion}`);
    }
  }

  if (commitCreated) {
    try {
      run(`git reset --hard ${releaseStartHead}`, { cwd: REPO_ROOT });
      console.log("✅ Commit de release revertido");
      return;
    } catch {
      console.warn("⚠️  No se pudo revertir el commit de release automáticamente");
    }
  }

  // If no release commit was created, restore touched files directly.
  try {
    writeFileSync(PKG_PATH, originalPkgContent);

    if (originalChangelogContent === null) {

View on GitHub (pinned to 0ec725320d)