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

What permissions do the GitHub Actions need? #61

Open
h0x0er opened this issue Feb 7, 2022 · 1 comment
Open

What permissions do the GitHub Actions need? #61

h0x0er opened this issue Feb 7, 2022 · 1 comment

Comments

@h0x0er
Copy link

h0x0er commented Feb 7, 2022

This GitHub Actions uses the GITHUB_TOKEN. Can you please tell me what permissions are used for this token? If the permissions are only used in certain conditions, e.g. when a certain input is specified, please share that info as well.

At https://github.com/step-security/secure-workflows we are building a knowledge-base (KB) of permissions needed by different GitHub Actions. When developers try to remediate ossf/Scorecards checks, they use the knowledge-base to secure their GitHub Workflows.

Here is an example of how we store KB for an Action:

name: "GH Release"
github-token:
  action-input:
    input: github_token
    is-default: true
  permissions:
    contents: write
    contents-reason: to create GitHub release #Reference: https://github.com/softprops/action-gh-release/blob/fe9a9bd3295828558c7a3c004f23f3bf77d155b2/README.md?plain=1#L70 

Releated Issue:
step-security/secure-repo#270

@matiasalbarello
Copy link
Collaborator

Hi @h0x0er. Thanks for your message. You're right, the documentation is not up to date with that change. I'll try to update it ASAP. For the time being, I'd say that the only required permission is the read checks:

  permissions:
    checks: read

The only GH API call that it does is through Oktokit client's method check_runs_for_ref.

Feel free to create a PR with the missing documentation if you can :)

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

No branches or pull requests

2 participants