Skip to content

Commit

Permalink
Use the actual job branch instead of always master
Browse files Browse the repository at this point in the history
  • Loading branch information
nkammah committed Nov 30, 2023
1 parent a223f2b commit bbf35bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .buildkite/scripts/cancel_running_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if [ -z ${GITHUB_PR_NUMBER+set} ] || [ -z ${GITHUB_PR_BASE_REPO+set} ];then
fi

running_builds_url="https://api.buildkite.com/v2/organizations/elastic/pipelines/${BUILDKITE_PIPELINE_SLUG}/builds"
running_builds_url+="?branch=${BUILDKITE_PIPELINE_DEFAULT_BRANCH}&state[]=scheduled&state[]=running"
running_builds_url+="?branch=${BUILDKITE_BRANCH}&state[]=scheduled&state[]=running"
jq_filter="map(select(any(.meta_data; .repo_pr == \"${GITHUB_PR_BASE_REPO}_${GITHUB_PR_NUMBER}\"))) | .[] .number"

for bn in $(curl -sH "Authorization: Bearer ${BUILDKITE_API_TOKEN}" $running_builds_url | jq -c "${jq_filter}"); do
Expand Down

0 comments on commit bbf35bf

Please sign in to comment.