-
Is it possible to get a list of the permissions of a given token? In one of my actions I would like to warn that the provided token is lacking a specific permission. The errors currently issued by just trying to do something and failing are not always easy to understand. If I could check the permission before failing I could issue a helpful warning like |
Beta Was this translation helpful? Give feedback.
Replies: 8 comments 3 replies
-
We seem have no available methods to list all the access scopes of a token. If you are the authenticated user of the token, you can try to navigate to Personal settings > Developer settings > Personal access tokens to view the access scopes of the tokens you have created. |
Beta Was this translation helpful? Give feedback.
-
Hi @brightran! interactively going to the token def will work, but it does not help in a script (unless you do some serious curl hacking I guess ;-)). So this seems like a request for a valuable extension to the API, right? |
Beta Was this translation helpful? Give feedback.
-
You can share a feature request in the Feedback form for GitHub. |
Beta Was this translation helpful? Give feedback.
-
Thanks @brightran, I entered a feature request. |
Beta Was this translation helpful? Give feedback.
-
It’s fairly easy to check the permissions of a token using the github API:
|
Beta Was this translation helpful? Give feedback.
-
Great henrik242! Thanks. |
Beta Was this translation helpful? Give feedback.
-
Hi @tombrus and everybody else - it's been quite some time since this was raised. Is the feature request still open and can I support it somewhere? |
Beta Was this translation helpful? Give feedback.
-
FYI if you have the GitHub CLI installed, this is also possible with the GITHUB_TOKEN=<your_token> gh auth status Seems like it would work to me |
Beta Was this translation helpful? Give feedback.
It’s fairly easy to check the permissions of a token using the github API: