File tree Expand file tree Collapse file tree 1 file changed +16
-15
lines changed
Expand file tree Collapse file tree 1 file changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -5,20 +5,21 @@ get_release_prs() {
55 local token=$1
66 local repo=$2
77 local desc=$3
8- local response=$( curl -s -H " Authorization: token $token " -H " Accept: application/vnd.github+json" " https://api.github.com/repos/$repo /pulls" )
9- # Extract PR numbers from the response JSON
10- echo " $response " | jq -r ' .[] | select(.title | startswith("$desc")) | .number'
11-
12- PR_NUMBER=$( echo " $response " | jq -r ' .[] | select(.title | startswith("$desc")) | .number' )
13-
14- if [ -n " $PR_NUMBER " ]; then
15- echo " $PR_NUMBER "
16- return 0 # PR found
17- else
18- echo " No PR found starting with '$desc '. Trying again in 60 seconds..."
19- sleep 60
20- return 1 # PR not found
21- fi
8+ while true ; do
9+ local response=$( curl -s -H " Authorization: token $token " -H " Accept: application/vnd.github+json" " https://api.github.com/repos/$repo /pulls" )
10+ # Extract PR numbers from the response JSON
11+ echo " $response " | jq -r ' .[] | select(.title | startswith("' $desc ' ")) | .number'
12+
13+ PR_NUMBER=$( echo " $response " | jq -r ' .[] | select(.title | startswith("' $desc ' ")) | .number' )
14+
15+ if [ -n " $PR_NUMBER " ]; then
16+ echo " $PR_NUMBER "
17+ return 0 # PR found
18+ else
19+ # echo "No PR found starting with '$desc'. Trying again in 60 seconds..."
20+ sleep 60
21+ fi
22+ done
2223}
2324
2425# Function to merge a PR
@@ -49,7 +50,7 @@ TOKEN=$1
4950REPO=$2
5051DESC=$3
5152
52- release_prs=$( get_release_prs " $TOKEN " " $REPO " " $DESC " )
53+ release_prs=$( get_release_prs " $TOKEN " " $REPO " " $DESC " ) ; do
5354
5455# Iterate over PR numbers and attempt to merge them
5556for pr_number in $release_prs ; do
You can’t perform that action at this time.
0 commit comments