This is an automated email from the ASF dual-hosted git repository.

ocket8888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 214333a1b0 Retry rebuilding RPM 10 times (#7278)
214333a1b0 is described below

commit 214333a1b0dfc6ee8d7c96274e10841fb54744c6
Author: Zach Hoffman <[email protected]>
AuthorDate: Wed Jan 11 08:50:14 2023 -0700

    Retry rebuilding RPM 10 times (#7278)
---
 .github/actions/build-rpms/build-rpms.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/.github/actions/build-rpms/build-rpms.sh 
b/.github/actions/build-rpms/build-rpms.sh
index 12a6ba40b8..09c39211dc 100755
--- a/.github/actions/build-rpms/build-rpms.sh
+++ b/.github/actions/build-rpms/build-rpms.sh
@@ -26,7 +26,15 @@ pkg_command=(./pkg -v)
 if [[ "$GITHUB_REF" == refs/pull/*/merge ]]; then
        sudo apt-get install jq
        pr_number="$(<<<"$GITHUB_REF" grep -o '[0-9]\+')"
-       files_changed="$(curl 
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/pulls/${pr_number}/files" | jq -r 
.[].filename)"
+       for ((i = 0; i < 10; i++)); do
+               response="$(curl 
"${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/pulls/${pr_number}/files")"
+               if files_changed="$(<<<"$response" jq -r .[].filename)"; then
+                       break
+               else
+                       echo "unexpected response body: ${response}"
+               fi
+               sleep 2
+       done
 else
        files_changed="$(git diff --name-only HEAD~4 HEAD --)" # Files changed 
by the last 4 commits
 fi

Reply via email to