We have a forked repo and is private and there are some security related PRs which we want to build on buildkite manually by using the UI of the Builldkite.
Is there any variable or any way to do this?
Hi @Avnshrai
There isn’t a way to trigger a build against a fork using the UI at the moment. You can configure your pipelines to build forks in the settings page though. That relies on webhooks from GitHub directly and is the only way to trigger a build for a fork.
You could introduce some logic in your pipeline that could read an environment variable and do some git stuff to checkout a fork though if thats an option for you.
We don’t want to run builds for every PR coming on that forked repo we want to run some specific PRs we can consider the last option you gave…
Is there any walkthrough you can suggest or some logic?
One other option I just thought of: you can define a block step as the first step in the pipeline, before any other steps or before the upload step that is conditional on the build being a fork. That way it blocks PR builds for you to approve but will build any other builds without interaction
- block: Allow this build to run?
prompt: ':rotating_light: Review the PR for concerning changes before unblocking'
if: build.pull_request.repository.fork
blocked_state: running
- command: buildkite-agent pipeline upload
label: ":pipeline:"
With this, it would create a build for every PR but it wouldn’t actually do anything until it is unblocked. That might be the quicker solution?
Otherwise, with the env solution I mentioned first, you would have to define an env var when you create a build from the UI. Then in your pipeline, your script would check for that env var, read it and checkout that branch instead.