Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: rate limit #327

Merged
merged 2 commits into from
Oct 6, 2020
Merged

ci: rate limit #327

merged 2 commits into from
Oct 6, 2020

Conversation

umarcor
Copy link
Collaborator

@umarcor umarcor commented Oct 6, 2020

In GitHub Actions a token is available by default (${{ github.token }}, see https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context). At the same time, get-toolchain.py expects an envvar named GH_TOKEN. In this PR, the envvar is set, so that authentication is used. This will hopefully reduce rate limit issues.

@umarcor
Copy link
Collaborator Author

umarcor commented Oct 6, 2020

@mithro, according to actions/runner-images#602 the rate limit issue with macOS jobs is because "all macOS VMs have the same IP". The recommended solution is using the default token, as proposed in this PR.

@@ -47,5 +47,7 @@ jobs:
ln -s $(which python) /usr/bin/python3

- run: python ./get-toolchain.py
env:
GH_TOKEN: ${{ github.token }}
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to be marked as a "secure" environment variable or something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No. It is secure, by itself. That is, the content of github.token depends on the context. If it is executed after someone with write privileges pushed a commit, it has some permissions. If it is executed in a fork, it has the permissions of the forker. If it is executed in a PR, it has read permissions but not write permissions.

This is not a Personal Access Token, which you would need to add to the "Secrets" in the settings of the repo, but it is a secret.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mithro mithro merged commit f7055f0 into im-tomu:master Oct 6, 2020
@umarcor umarcor deleted the ci/rate-limit branch October 6, 2020 05:15
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.

2 participants