diff --git a/.github/workflows/comment-to-trigger-teamcity.yml b/.github/workflows/comment-to-trigger-teamcity.yml index 92336f430f5fe1..5e40d1c0cfcece 100644 --- a/.github/workflows/comment-to-trigger-teamcity.yml +++ b/.github/workflows/comment-to-trigger-teamcity.yml @@ -230,6 +230,12 @@ jobs: # Matches .sh files under regression-test/pipeline/ but excludes files under conf/ subdirectories. source regression-test/pipeline/common/github-utils.sh + if [[ ! -f all_files ]]; then + echo "WARNING: all_files not found (GitHub API call likely failed in previous step)." + echo "Skipping sensitive check — previous step already defaulted to trigger-all." + exit 0 + fi + changed_sensitive=false while IFS= read -r f; do if [[ "${f}" == regression-test/pipeline/*.sh || diff --git a/regression-test/pipeline/common/github-utils.sh b/regression-test/pipeline/common/github-utils.sh index ca3977bfc4c835..048b282701ecf0 100644 --- a/regression-test/pipeline/common/github-utils.sh +++ b/regression-test/pipeline/common/github-utils.sh @@ -131,7 +131,9 @@ _get_pr_changed_files_count() { while [[ ${try_times} -gt 0 ]]; do set -x if ret=$( - curl -s -H "Accept: application/vnd.github+json" \ + curl -s \ + -H "Accept: application/vnd.github+json" \ + ${GITHUB_TOKEN:+-H "Authorization: Bearer ${GITHUB_TOKEN}"} \ https://api.github.com/repos/"${OWNER}"/"${REPO}"/pulls/"${PULL_NUMBER}" | jq -e '.changed_files' ); then set +x @@ -169,6 +171,7 @@ _get_pr_changed_files() { set -x if curl -s \ -H "Accept: application/vnd.github+json" \ + ${GITHUB_TOKEN:+-H "Authorization: Bearer ${GITHUB_TOKEN}"} \ https://api.github.com/repos/"${OWNER}"/"${REPO}"/pulls/"${PULL_NUMBER}"/files?page="${page}"\&per_page="${per_page}" \ >>"${file_name}"; then set +x