version_bump/plugins/github
The GitHub publish plugin.
Mirrors @semantic-release/github’s core responsibility: authenticate with
a GitHub token, resolve the target repository, and create a GitHub Release
for the version semantic-release just determined.
Hooks implemented:
- verify_conditions: a
GITHUB_TOKEN/GH_TOKENand a resolvable repository URL must be present, otherwise the pipeline aborts. - publish: create the GitHub release and return it.
- success: log that the release was published.
Effectful work (HTTP, environment access) is kept in the hook bodies; the
pure decision logic lives in helpers (resolve_token, is_prerelease,
verify) so it can be unit-tested without a network or live environment.
Values
pub fn is_prerelease(next_release: release.NextRelease) -> Bool
Whether the upcoming release is a prerelease (i.e. its channel-tied version
carries a prerelease identifier such as -beta.1).
pub fn verify(
token: option.Option(String),
config: config.Config,
) -> Result(Nil, error.ReleaseError)
PURE verification: given a resolved token (if any) and the config, decide whether the GitHub plugin can run. Separated out so it can be tested without touching the process environment.