Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass the --update-head-ok to fetch for PRs out of main #2904

Merged
merged 3 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .buildkite/build_pr_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ steps:
fi
depends_on:
- step: "build-pr"
allow_failure: true
- wait
- key: "branch-comparison"
label: "Compare branches"
Expand Down
3 changes: 2 additions & 1 deletion .buildkite/scripts/build_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ if [[ "${GITHUB_PR_BASE_REPO}" != 'docs' ]]; then
git@github.com:elastic/$GITHUB_PR_BASE_REPO.git ./product-repo

cd ./product-repo &&
git fetch origin pull/$GITHUB_PR_NUMBER/head:$GITHUB_PR_BRANCH &&
git fetch --update-head-ok origin pull/$GITHUB_PR_NUMBER/head:$GITHUB_PR_BRANCH &&
git switch $GITHUB_PR_BRANCH &&
git rev-parse HEAD &&
cd ..
# For product repos - context in https://github.com/elastic/docs/commit/5b06c2dc1f50208fcf6025eaed6d5c4e81200330
build_args+=" --keep_hash"
Expand Down
1 change: 1 addition & 0 deletions .buildkite/scripts/build_pr_commit_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -euo pipefail

# This hook should only be invoked for builds triggered by the Buildkite PR bot
if [ -z ${GITHUB_PR_BASE_OWNER+set} ] || [ -z ${GITHUB_PR_BASE_REPO+set} ] || [ -z ${GITHUB_PR_TRIGGERED_SHA+set} ];then
echo "Build not triggered via Buildkite PR bot - skipping setting status check"
exit 0
fi

Expand Down