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

Need extra permissions for creating a pull request from octokit/rest api

For "POST /repos/:owner/:repo/pulls" or

octokit.pulls.create({
owner,
repo,
title,
head,
base
})


I kept getting a "Validation Failed, not all refs are readable" code 422. To fix this I had to add extra permissions for my GitHub bot:
Contents- Read & Write
Issues- Read & Write
Pull Request- Read & Write

 

However, on the developer docs here, it says that the only permissions that my bot needs to create a PR is pull request with "read & write" permissions, and not the extra content/issues permissions. Is this a mistake / bug with the api or the documentation?

1 Reply
Highlighted
Community Manager
Message 2 of 2

Re: Need extra permissions for creating a pull request from octokit/rest api

Hi @kevo1ution,

 

Thank you for being here! Sorry for the trouble here. So that we can identify if the issue is the octokit library, or with the API itself could you please send us the full output of a curl -v request that demonstrates the problem? 


http://curl.haxx.se/
 
That should help us investigate the issue. Also, please make sure you mask any sensitive information like OAuth tokens and Authorization headers in the output of the curl command. Please send the output to https://github.com/contact. And include a link to this thread to give support some background on the ticket.
 
Best,
Andrea


I hope this helps, AndreaG

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