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

pr-title-conventional-commits: create PR comment only if permissions are properly set #93

Open
tbouffard opened this issue Nov 10, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@tbouffard
Copy link
Member

tbouffard commented Nov 10, 2022

This is an improvement for comment: auto after we implement #82

In #82, we create PR comment if the PR has not be created from a forked repository. But if the GH_TOKEN hasn't the right permissions, the PR creation will fail.
Instead, I propose that we find a way to check the permission and that we only create the PR comment if the permission are set correctly.

This will cover more use cases.

Getting the permissions

This may require to use or develop a dedicated action

Resources about getting the permissions

https://github.com/orgs/community/discussions/25259 to retrieve the oauth scopes of a token
the following actions check the permissions of an actor (write or admin). But nothing about the token permissions

See also https://michaelheap.com/access-secrets-from-forks/ --> https://github.com/actions-cool/check-user-permission

Alternatives

As mentioned in the README of the action since #107, it is advised to trigger the workflow calling the action on pull_request_target events. So, the GH_TOKEN can have the permission to write PR comment even when the PR is created from a fork.
Implementing what is described in this issue would only help when setting up the configuration of the workflow calling the action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant