is_pull_request
Whether the current CI run was triggered by a pull request (or merge request).
It looks at the variable each service sets for that: GITHUB_EVENT_NAME (pull_request or
pull_request_target), CI_MERGE_REQUEST_IID on GitLab, CIRCLE_PULL_REQUEST,
TRAVIS_PULL_REQUEST, BUILDKITE_PULL_REQUEST, SYSTEM_PULLREQUEST_PULLREQUESTID on Azure,
BITBUCKET_PR_ID, DRONE_PULL_REQUEST, APPVEYOR_PULL_REQUEST_NUMBER, PULL_REQUEST on
Netlify and VERCEL_GIT_PULL_REQUEST_ID. Services without a known variable (Jenkins,
TeamCity, …) and any environment outside CI give false.
Import
Section titled “Import”Cargo feature ci (enabled by default). To compile only this module:
or in Cargo.toml:
Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
get | &dyn Fn(&str) -> Option<String> | Looks a variable up by name. |
Returns
Section titled “Returns”bool — true for a pull request run.
