Skip to content

Commit 62a7232

Browse files
authored
Use proper env variables for posting the commit status on product repos (#2842)
1 parent 39c83fd commit 62a7232

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.buildkite/scripts/build_pr_commit_status.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -euo pipefail
44

55
# This hook should only be invoked for builds triggered by the Buildkite PR bot
6-
if [ -z ${GITHUB_PR_OWNER+set} ] || [ -z ${GITHUB_PR_REPO+set} ] || [ -z ${GITHUB_PR_TRIGGERED_SHA+set} ];then
6+
if [ -z ${GITHUB_PR_BASE_OWNER+set} ] || [ -z ${GITHUB_PR_BASE_REPO+set} ] || [ -z ${GITHUB_PR_TRIGGERED_SHA+set} ];then
77
exit 0
88
fi
99

@@ -20,10 +20,10 @@ case $status_state in
2020
exit 1;;
2121
esac
2222

23-
githubPublishStatus="https://api.github.com/repos/${GITHUB_PR_OWNER}/${GITHUB_PR_REPO}/statuses/${GITHUB_PR_TRIGGERED_SHA}"
23+
githubPublishStatus="https://api.github.com/repos/${GITHUB_PR_BASE_OWNER}/${GITHUB_PR_BASE_REPO}/statuses/${GITHUB_PR_TRIGGERED_SHA}"
2424
data='{"state":"'$status_state'","target_url":"'$BUILDKITE_BUILD_URL'","description":"'$description'","context":"buildkite/'$BUILDKITE_PIPELINE_SLUG'"}'
2525

26-
echo "Setting buildkite/${BUILDKITE_PIPELINE_SLUG} commit status to ${status_state}"
26+
echo "Setting commit status: buildkite/${BUILDKITE_PIPELINE_SLUG} - ${status_state}"
2727
curl -s -L \
2828
-X POST \
2929
-H "Accept: application/vnd.github+json" \

0 commit comments

Comments
 (0)