monorepo-diff-buildkite-plugin
monorepo-diff-buildkite-plugin copied to clipboard
PR-related environment variables not passed down.
This is likely a buildkite issue, but it'd be good to know if anyone else is seeing this.
I have the usual:
- Webhook triggers pipeline
- Pipeline has single step, which is using this plugin
- Plugin starts 1 or more other pipelines
If I look at the environment of the first step, I can see that BUILDKITE_PULL_REQUEST
and a few others are set. Yay. Expected.
If I look at the "1 or more" others, it is not - its set to false
for no PR.
Likely also
BUILDKITE_PULL_REQUEST_BASE_BRANCH
BUILDKITE_PULL_REQUEST_REPO
I'd EXPECT buildkite pipeline upload....
to look at it, and carry them across, but it appears it doesn't. Anyone else see this, or have a work around? I need that specific variable name for the tool (DangerJs) I'm using, and likely other stuff too.
turns out you have to manually pass them all thru.
- path:
- "paths-here/"
config:
trigger: "thing-to-trigger"
build:
env:
- BUILDKITE_PULL_REQUEST
- BUILDKITE_PULL_REQUEST_BASE_BRANCH
- BUILDKITE_PULL_REQUEST_REPO
I'm having the same problem. In my case the env
attributes for build
are not being passed to the triggered buildkite pipeline. Any help will be really appreciated.
- label: "Building Docker Images"
plugins:
- chronotc/monorepo-diff#v2.3.0:
diff: "git diff --name-only HEAD~1"
watch:
- path:
- project1/
config:
trigger: docker-build
label: Build and Publish docker
build:
env:
ENV_VAR: "./dir"
ENV_BAR: "tag"
Thanks in advance for reading.
I just realized that env variables MUST be pass this way - ENV=VALUE
trigger: docker-build
label: Build and Publish docker
build:
env:
- ENV_VAR="./dir" <======= This solve my problem.
- ENV_BAR="tag"