There is no way to check for a Github action's github.token permissions #73397
Replies: 2 comments 5 replies
-
Hey @gautamkrishnar, Thank you so much for sharing your feedback here. I'll go ahead and get this filed for you so that your feedback reaches the correct teams here at GitHub. Thanks again! 🚀 |
Beta Was this translation helpful? Give feedback.
-
Hi @gautamkrishnar, I wonder if the issue that you're seeing here is due to the security measures in place for pull requests from forked repositories. As per GitHub's policy, workflow runs that are triggered by such pull requests are treated as if they're coming from a public repository. This means they receive a read-only GITHUB_TOKEN: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#permissions-for-the-github_token. This is done to prevent malicious users from creating a pull request that alters your repository's workflows or accesses sensitive data. Unfortunately, there's no direct way to grant write permissions to the GITHUB_TOKEN for pull requests from forks. |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Bug
Body
If we try using:
We always gets the following response:
Which is technically wrong, since I have the read/write permission enabled for the default token for the example repo.
GitHub needs to fix this behavior and make the actual permission visible in this case. GitHub action developers are unable to check for the token permissions due to this issue.
Beta Was this translation helpful? Give feedback.
All reactions