We recently added a pre-build pipeline before our various pipelines that get run whenever a PR is opened via a GitHub webhook, which then triggers a handful of other pipelines.
However, in the child pipelines that are triggered by the pre-build pipeline, any steps that attempt to check if the build is a PR or not via Buildkite env vars fail because only the initial pre-build pipeline seems to set
BUILDKITE_PULL_REQUEST, BUILDKITE_PULL_REQUEST_BASE_BRANCH, BUILDKITE_PULL_REQUEST_REPO env vars. I’ve tried overriding these in the child pipelines via the
env attribute in the trigger step, however these env vars appear to be read-only and cannot be overridden.
It’d be really handy if the trigger step allowed you to set any child builds to inherit these PR env vars, so the PR status of a build could get passed through to any subsequent pipelines.