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

Specify scopes needed for GITHUB_TOKEN #114

Closed
miparnisari opened this issue Mar 31, 2023 · 2 comments · Fixed by #122
Closed

Specify scopes needed for GITHUB_TOKEN #114

miparnisari opened this issue Mar 31, 2023 · 2 comments · Fixed by #122

Comments

@miparnisari
Copy link

miparnisari commented Mar 31, 2023

https://github.com/bufbuild/buf-setup-action/blob/142056acbddd5ea00e4b7d2834868cd40ed12aca/README.md?plain=1#LL36

Can you please clarify what scopes the token needs?

@rhbuf
Copy link
Contributor

rhbuf commented Apr 10, 2023

hi @miparnisari taking a quick look at the code, we use the github token in octokit to call for the latest buf to download:

buf-setup-action/src/buf.ts

Lines 136 to 137 in ffdd84c

const octokit = new Octokit({
auth: githubToken,

Which uses these endpoints:

GET /repos/{owner}/{repo}/releases
GET /repos/{owner}/{repo}/releases/tags/{tag}

so the token would need contents:read permission. If that sounds sensible then I can put a PR up to clarify this in the README.

@miparnisari
Copy link
Author

Yes please :)

rhbuf added a commit that referenced this issue Apr 20, 2023
The README did not make it clear what scopes were needed by the github
token that was provided to the action. I have added a section explaining
this and also an example of using the `GITHUB_TOKEN` secret.

Fixes #114
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 a pull request may close this issue.

2 participants