aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorBrad Corso <bcorso@google.com>2023-01-05 13:19:04 -0800
committerDagger Team <dagger-dev+copybara@google.com>2023-01-06 00:00:44 -0800
commit26aeec4732e2d71bf0b84aee2a35ffe833e87d8e (patch)
treebd4b81df6501230a60e0d7acc67b8ceb38ca1656 /util
parentbab5b74c25b26d4d159cd137e61f7d6a8acc9d0a (diff)
downloaddagger2-26aeec4732e2d71bf0b84aee2a35ffe833e87d8e.tar.gz
Fix GitHub Actions "rate limit exceeded" issues.
This fixes a recent issue where we've been getting "rate limit exceeded" when accessing GitHub's REST APIs to get verify the current Dagger version. For example: https://github.com/google/dagger/actions/runs/3844265780/jobs/6547217742 RELNOTES=N/A PiperOrigin-RevId: 499988884
Diffstat (limited to 'util')
-rwxr-xr-xutil/latest-dagger-version.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/util/latest-dagger-version.sh b/util/latest-dagger-version.sh
index 55b3efde8..ebb7a8dc0 100755
--- a/util/latest-dagger-version.sh
+++ b/util/latest-dagger-version.sh
@@ -7,7 +7,13 @@ function github-rest-api {
local GITHUB_API_HEADER_ACCEPT="Accept: application/vnd.github.v3+json"
- curl -s $GITHUB_REST_API -H $GITHUB_API_HEADER_ACCEPT
+ if [ -z "$GH_TOKEN" ]; then
+ curl -s $GITHUB_REST_API -H $GITHUB_API_HEADER_ACCEPT
+ else
+ curl -s $GITHUB_REST_API \
+ -H $GITHUB_API_HEADER_ACCEPT \
+ -H "authorization: Bearer $GH_TOKEN"
+ fi
}
function github-latest-release-tag {