From 14394968052997fa99448077c65cc46cb1a3fd7e Mon Sep 17 00:00:00 2001 From: kruskall <99559985+kruskall@users.noreply.github.com> Date: Wed, 11 Sep 2024 22:21:43 +0200 Subject: [PATCH] fix: always diff against the remote branch (#3064) the check fails if we're targeting a branch that is not the default branch. Since we run git fetch before the diff, we know for a fact that the remote branch exist so just specify the remote and use the remote branch in the diff. --- .buildkite/scripts/build_pr.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.buildkite/scripts/build_pr.sh b/.buildkite/scripts/build_pr.sh index 294060c22689..d1854c0ad122 100755 --- a/.buildkite/scripts/build_pr.sh +++ b/.buildkite/scripts/build_pr.sh @@ -56,7 +56,7 @@ if [[ "${GITHUB_PR_BASE_REPO}" != 'docs' ]]; then if [[ "${GITHUB_PR_BASE_REPO}" == 'apm-agent-go' ]]; then git fetch origin "$GITHUB_PR_TARGET_BRANCH" - docs_diff=$(git diff --stat "$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs CHANGELOG.asciidoc) + docs_diff=$(git diff --stat "origin/$GITHUB_PR_TARGET_BRANCH"...HEAD -- ./docs CHANGELOG.asciidoc) else docs_diff="always build" fi