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

Describe which permissions this action needs #45

Closed
MPV opened this issue Nov 16, 2023 · 4 comments · Fixed by #48
Closed

Describe which permissions this action needs #45

MPV opened this issue Nov 16, 2023 · 4 comments · Fixed by #48

Comments

@MPV
Copy link

MPV commented Nov 16, 2023

Hi,
Could we please document which permissions that's needed to be able to use this action?

Docs for this is here:

@MPV
Copy link
Author

MPV commented Nov 16, 2023

For example, running linters such as checkov on workflows using what's suggested in this action might give warnings like:

github_actions scan results:

Passed checks: 0, Failed checks: 1, Skipped checks: 0

Check: CKV2_GHA_1: "Ensure top-level permissions are not set to write-all"
	FAILED for resource: on(Reviewdog suggester)
Error: 	File: /.github/workflows/reviewdog-suggester.yaml:0-1

@MPV
Copy link
Author

MPV commented Nov 16, 2023

Is this the way to go?

permissions:
  contents: write

Or could we do with even less permissions?

@adityaraute
Copy link

How do we verify though? Every repo may have different restrictions on permissions like this one prevents a write-all permission. I wonder if we can do anything about it

@shogo82148
Copy link
Contributor

we don't need contents: write, contents: read is enough.
To write review comments and checks, we need some extra permissions:

permissions:
  contents: read
  checks: write
  issues: write
  pull-requests: write 

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.

3 participants