Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 3
Message 1 of 2

Retrieve permissions as a GitHub App Installation

I want to find out if I have write access to a repository. Using a personal access token, that is simple enough, by reading out the scopes from the `X-OAuth-Scopes` response header or by reading the `permissions` key from the response of `GET /repos/:owner/:repo`.

 

But there is no such thing for GitHub installation tokens, is it?

 

My current problem is that I want to run [semantic-release](https://github.com/semantic-release/semantic-release) in GitHub Actions, and it verifies the authentication by sending the `GET /repos/:owner/:repo` request. But the `GITHUB_TOKEN` provided to GitHub Actions is in fact an installation token so this verification step fails.

1 Reply
Highlighted
Community Manager
Message 2 of 2

Re: Retrieve permissions as a GitHub App Installation

Hi @gr2m,

 

Thanks for being here! You could try to fetch a list of repositories that the installation has access to:

https://developer.github.com/v3/apps/installations/#list-repositories

The response is a JSON array, where each element is a repository including the `permissions` hash that you’re looking for. I hope this helps!


Best,
AndreaG

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!