CodeVetter · Repo Unpack · Data flow
semantic-release/semantic-release
Configuration and CI detection establish a mutable core context for each invocation. Remote branch names, merged tags, Git notes, and commit history become normalized release inputs. Plugin pipelines transform those inputs into release decisions and outputs, which the core persists to Git before provider publication.
- Configuration merges discovered values with CLI/API options, reduces shareable configurations in order, then overlays explicit options and non-null defaults.
- envCi derives the execution branch from the supplied environment and cwd; run uses prBranch for pull requests and branch otherwise.
- getGitAuthUrl normalizes hosted shortcuts and git+HTTP URLs, tries existing authentication, and falls back to selected environment credentials embedded in a formatted URL.
- Branch discovery expands remote patterns, fetches each matching branch and notes, loads tags, classifies branch types, normalizes ranges, and aggregates validation errors.
- get-tags builds a regex from tagFormat, checks parsed versions with semver, attaches note channels, and treats tags without parsed notes as belonging to the default channel.
- getLastRelease selects the highest eligible tag; getCommits reads from its resolved head to nextRelease.gitHead or HEAD and trims parsed messages and tag decorations.
- Plugin wrappers bind cloned global/local configuration and clone context data while preserving streams and supplying a scoped logger; pipeline input changes occur through getNextInput.
- Publication writes the tag and channel note and pushes both before provider hooks; publish results combine nextRelease metadata, provider output, and plugin identity before entering context.releases.