Skip to content

Conversation

@claudusd
Copy link
Collaborator

@claudusd claudusd commented Sep 7, 2023

Purpose

If we execute a lot of Arnold command, this will reach the Github API rate limiting.
When we reach the limit Arnold will fail because it can parse the Github response and stop with this error

jq: error (at <stdin>:1): Cannot index object with number

Proposal

Use the environment variable GITHUB_TOKEN to authenticate to the Github API and increase the API rate limiting.

Github has an API rate limiting. This rate limiting could
Be increase if we are authenticated. If the environment
variable GITHUB_TOKENiIs defined Arnold will use it to auth.
@claudusd claudusd force-pushed the github_rate_limiting branch from e15f1b0 to ad3c560 Compare September 7, 2023 18:01
@claudusd claudusd marked this pull request as ready for review September 8, 2023 09:14
@claudusd claudusd requested a review from jmaupetit September 8, 2023 09:14
### Changed
### Added

- Use Gitlab token when call the Github's API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Use Gitlab token when call the Github's API
- Use GitHub token to call Github's API when the `GITHUB_TOKEN` environment variable is defined


# Get the latest Arnold release by querying Github's API
function _get_latest_release() {
local auth_header=()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer declare which is more explicit as it can cast vars:

Suggested change
local auth_header=()
declare -a auth_header

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants