diff --git a/ci/buildkite-pipeline-in-disk.sh b/ci/buildkite-pipeline-in-disk.sh index 56c5b06201459e..bf9003106619a2 100644 --- a/ci/buildkite-pipeline-in-disk.sh +++ b/ci/buildkite-pipeline-in-disk.sh @@ -9,7 +9,13 @@ cd "$(dirname "$0")"/.. output_file=${1:-/dev/stderr} if [[ -n $CI_PULL_REQUEST ]]; then - IFS=':' read -ra affected_files <<< "$(buildkite-agent meta-data get affected_files)" + # filter pr number from ci branch. + [[ $CI_BRANCH =~ pull/([0-9]+)/head ]] + pr_number=${BASH_REMATCH[1]} + echo "get affected files from PR: $pr_number" + + # get affected files + readarray -t affected_files < <(gh pr diff --name-only "$pr_number") if [[ ${#affected_files[*]} -eq 0 ]]; then echo "Unable to determine the files affected by this PR" exit 1 diff --git a/ci/buildkite-pipeline.sh b/ci/buildkite-pipeline.sh index 21f0b2a68c8ab8..e1c268ca2f9f76 100755 --- a/ci/buildkite-pipeline.sh +++ b/ci/buildkite-pipeline.sh @@ -9,7 +9,13 @@ cd "$(dirname "$0")"/.. output_file=${1:-/dev/stderr} if [[ -n $CI_PULL_REQUEST ]]; then - IFS=':' read -ra affected_files <<< "$(buildkite-agent meta-data get affected_files)" + # filter pr number from ci branch. + [[ $CI_BRANCH =~ pull/([0-9]+)/head ]] + pr_number=${BASH_REMATCH[1]} + echo "get affected files from PR: $pr_number" + + # get affected files + readarray -t affected_files < <(gh pr diff --name-only "$pr_number") if [[ ${#affected_files[*]} -eq 0 ]]; then echo "Unable to determine the files affected by this PR" exit 1 diff --git a/ci/buildkite-solana-private.sh b/ci/buildkite-solana-private.sh index d05972808ae976..52249490b7ae32 100644 --- a/ci/buildkite-solana-private.sh +++ b/ci/buildkite-solana-private.sh @@ -9,7 +9,13 @@ cd "$(dirname "$0")"/.. output_file=${1:-/dev/stderr} if [[ -n $CI_PULL_REQUEST ]]; then - IFS=':' read -ra affected_files <<< "$(buildkite-agent meta-data get affected_files)" + # filter pr number from ci branch. + [[ $CI_BRANCH =~ pull/([0-9]+)/head ]] + pr_number=${BASH_REMATCH[1]} + echo "get affected files from PR: $pr_number" + + # get affected files + readarray -t affected_files < <(gh pr diff --name-only "$pr_number") if [[ ${#affected_files[*]} -eq 0 ]]; then echo "Unable to determine the files affected by this PR" exit 1