Skip to main content

pull_request_is_version_pr

Function pull_request_is_version_pr 

Source
pub fn pull_request_is_version_pr() -> Result<bool>
Expand description

Whether the pull request of this pull_request event is a Version PR by the identity of the version-pr-identity design §1. Its head repository is this repository, and its head branch is verctl/release/<base> for the base it targets now.

The check reads all three through the API when it runs. It never reads the event payload, because a base can change after the event and a label applied after opening is missing from the opened payload. It never reads the title, body, or labels, and it ignores GITHUB_HEAD_REF.

Without an event, or for an event that is not a pull request’s, it is false.

§Errors

Returns an error when the event names a pull request but no token is set. It also returns one when GITHUB_REPOSITORY is not owner/name or GitHub cannot read the pull request.