Skip to main content

base_branch_with

Function base_branch_with 

Source
pub fn base_branch_with(
    configured: Option<String>,
    upstream: impl FnOnce() -> Option<String>,
) -> Result<String>
Expand description

The branch a Version PR targets: GITHUB_REF_NAME, else VERCTL_DEFAULT_BRANCH, else the branch origin/HEAD names.

If none of them is set, the call fails instead of guessing. A repository whose default is not main would otherwise get a Version PR against a branch it does not release from.

ยงErrors

Returns an error when none of those three sources names a branch.