You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have created a GitHub App, one of its functions is to (on behalf of a GitHub user) fork an (upstream) repository on their behalf, create a branch, make some commits to the branch, and then send a PR from their fork back to the upstream repository.
Unfortunately when our App tries to open the PR against the upstream repository we are getting the following error response from the GitHub API: "resource not accessible by integration".
Below is a code snippet where we are using JavaScript and the GitHub provided Octokit library (see: https://github.com/octokit) to try and achieve this.
What are we doing wrong?
// get the access token for the installationconstinstallationId=0;// Your installation ID// Authenticate as the GitHub App using the JWTconstjwttoken=``constoctokitApp=newOctokit({auth: jwttoken,});constresponse=awaitoctokitApp.request('POST /app/installations/{installation_id}/access_tokens',{installation_id: installationId,// Your installation ID});constaccessToken=response.data.token;constoctokit=newOctokit({auth: accessToken});constresponse=awaitoctokit.pulls.create({owner: 'evolvedbinary',repo: 'prosemirror-lwdita',title: 'Update README.md',body: `This pull request was created by **Petal-demo bot**`,head: 'marmoure:patch-1',base: 'main',});
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We have created a GitHub App, one of its functions is to (on behalf of a GitHub user) fork an (upstream) repository on their behalf, create a branch, make some commits to the branch, and then send a PR from their fork back to the upstream repository.
For our App we have followed the "Authenticate as an app installation" method (see: https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) as we want to "attribute app activity to the app".
Unfortunately when our App tries to open the PR against the upstream repository we are getting the following error response from the GitHub API: "resource not accessible by integration".
It seems that other apps such as Depenadabot (see: https://github.com/apps/dependabot) are capable of doing this, for example where it opened this PR: evolvedbinary/exist#27.
Below is a code snippet where we are using JavaScript and the GitHub provided Octokit library (see: https://github.com/octokit) to try and achieve this.
What are we doing wrong?
Beta Was this translation helpful? Give feedback.
All reactions