slow down the changelog script to prevent rate limiting (#9172)
* slow down the changelog script to prevent rate limiting
This commit is contained in:
parent
dcd8673817
commit
949908e48b
|
@ -16,8 +16,8 @@ is_doc_or_tech_debt_pr(){
|
||||||
| jq '[.labels[].name == "docs" or .labels[].name == "tech-debt"] | any')
|
| jq '[.labels[].name == "docs" or .labels[].name == "tech-debt"] | any')
|
||||||
exy="$?"
|
exy="$?"
|
||||||
if [ $exy -ne 0 ]; then
|
if [ $exy -ne 0 ]; then
|
||||||
echo "bad response from github"
|
echo "bad response from github: manually check PR ${PR_NUM}"
|
||||||
exit $exy
|
return $exy
|
||||||
fi
|
fi
|
||||||
grep -q true <<< $out
|
grep -q true <<< $out
|
||||||
return $?
|
return $?
|
||||||
|
@ -40,6 +40,7 @@ get_prs(){
|
||||||
done | while read PR_NUM
|
done | while read PR_NUM
|
||||||
do
|
do
|
||||||
if (($DO_PR_CHECK)) && is_doc_or_tech_debt_pr $PR_NUM; then
|
if (($DO_PR_CHECK)) && is_doc_or_tech_debt_pr $PR_NUM; then
|
||||||
|
echo "Skipping PR ${PR_NUM}: labeled as tech debt or docs. (waiting a second so we don't get rate-limited...)"
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
echo "https://github.com/hashicorp/packer/pull/${PR_NUM}"
|
echo "https://github.com/hashicorp/packer/pull/${PR_NUM}"
|
||||||
|
@ -59,6 +60,9 @@ get_prs | while read line; do
|
||||||
echo $line
|
echo $line
|
||||||
if [[ "$line" =~ "bad" ]]; then
|
if [[ "$line" =~ "bad" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
|
elif [[ "$line" =~ "Skipping" ]]; then
|
||||||
|
sleep 1 # GH will rate limit us if we have several in a row
|
||||||
|
continue
|
||||||
fi
|
fi
|
||||||
vared -ch ok
|
vared -ch ok
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue