Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #94
Closes #93
This PR implements a permissions check for the used token. If the token is a PAT it represents the user associated with this PAT. Hence, it is a permissions/rights check for the user's PAT for the particular repository.
"admin"
permission (granted through the "Admin" role or as owner) is necessary to access a protected branch: get info about the status of required checks and to toggle the "review required"-protection rule.If the token does not have this permission level, the action will fail when/if trying to do these jobs. This will only happen for protected branches however, so technically the check is done if the the branch is detected to be protected - something that can be done with the lowest of rights (for a public repo, for a private repo a token representing a user with at least "pull" permission ("Read" role) still need to be supplied).