CodeVetter · Repo Unpack · Behavior traces
semantic-release/semantic-release
The inspected flows include CLI startup, new-version publication, and promotion of an existing release to another channel. Additional branches explain dry-run behavior, skipped releases, preparation commits, and failures. Execution order comes from implementation rather than the README's simplified step table.
- Startup: bin checks Node and launches execa(git --version), then calls cli; cli parses options, enables debug if requested, imports index.js, and the API installs masking, detects CI, creates a logger, calls getConfig, then run.
- Eligibility: run forces dry-run outside known CI unless noCi is set, skips CI pull requests unless noCi, then calls verify, getGitAuthUrl, and getBranches; a branch absent from normalized release branches returns false.
- Authorization: run calls verifyAuth; if that fails, isBranchUpToDate can return false and skip publication, otherwise the error becomes EGITNOPERMISSION before verifyConditions runs.
- New version: getLastRelease → getTagHead when available → getCommits → analyzeCommits → getGitHead → getNextVersion → makeTag; non-prerelease versions outside branch.range throw EINVALIDNEXTVERSION.
- Publication: verifyRelease → generateNotes → prepare → tag → addNote → push → pushNotes → publish → success; the API finally returns selected context fields.
- Preparation commits: after each prepare plugin, getGitHead detects a changed HEAD, updates nextRelease.gitHead, regenerates notes, and passes updated release data to the following prepare plugin.
- Channel promotion: getReleaseToAdd chooses an eligible merged version → getTagHead resolves release heads → maintenance mergeRange is checked → getCommits and generateNotes run → updated channel notes are pushed → addChannel and success run.
- Failure: run errors enter callFail, which sends only semanticRelease errors to fail plugins and logs fail-hook errors; the outer catch logs the original error, removes output hooks, and rethrows for CLI exit code 1.