Skip to content

Commit

Permalink
feat: allow passing Github Token to downloader script (#206)
Browse files Browse the repository at this point in the history
```bash
GITHUB_TOKEN=$(gh auth token) VERSION=v2 PARAMS="stuff"  ./run.sh
```
This will allow our CI runners to pass in a github token to hopefully
avoid those random contract test failures when we are rate limited.
  • Loading branch information
cwaldren-ld committed May 3, 2024
1 parent 00412a0 commit 06fe68e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions downloader/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ if [ -n "${GITHUB_TOKEN}" ]; then
AUTH_HEADER="Authorization: Token ${GITHUB_TOKEN}"
fi

# Github rate-limits requests to its APIs. The effect is that sometimes the contract test step in CI
# will fail spuriously when trying to find the list of releases.
# If we provide an auth token, then we can avoid the rate limiting issues.
if [ -n "${GITHUB_TOKEN}" ]; then
AUTH_HEADER="Authorization: Token ${GITHUB_TOKEN}"
fi

if [ -z "${VERSION}" -o -z "${PARAMS}" ]; then
echo 'You must specify a version string in $VERSION and command parameters in $PARAMS' >&2
exit 1
Expand Down

0 comments on commit 06fe68e

Please sign in to comment.