Skip to content

Commit

Permalink
Dry-run call to GH API on validating open PRs
Browse files Browse the repository at this point in the history
With the addition of tests, we're quickly exhausting the rate-limit on
GH's API.
To avoid this, dry run the call which checks if any PRs are open while
testing.

Signed-off-by: Mike Kolesnik <[email protected]>
  • Loading branch information
mkolesnik committed Sep 8, 2022
1 parent 3ac68a9 commit 6c85344
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/lib/utils
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function read_release_file() {
# Based on global "dryrun" variable
function dryrun() {
if [[ "$dryrun" = "true" ]]; then
echo DRY RUNNING: "${@:1}"
>&2 echo DRY RUNNING: "${@:1}"
return
fi

Expand Down
2 changes: 1 addition & 1 deletion scripts/validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function validate_no_update_prs() {
local update_prs

for project; do
if ! update_prs="$(gh_api "pulls?base=${release['branch']:-devel}&head=${ORG}:${head}&state=open" | jq -r ".[].html_url")"; then
if ! update_prs="$(dryrun gh_api "pulls?base=${release['branch']:-devel}&head=${ORG}:${head}&state=open" | jq -r ".[].html_url")"; then
printerr "Failed to list pull requests for ${project}."
return 1
fi
Expand Down

0 comments on commit 6c85344

Please sign in to comment.