Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation ID maybe not following github_api_url #97

Open
bosch-ch opened this issue Oct 5, 2023 · 4 comments
Open

Installation ID maybe not following github_api_url #97

bosch-ch opened this issue Oct 5, 2023 · 4 comments

Comments

@bosch-ch
Copy link

bosch-ch commented Oct 5, 2023

Very excited to see the V2 update features!

I'm using GitHub Enterprise server. It looks like the update may not be following the github_api_url input. Tried with both retrieval mode=organization (gets a 404, but no useful log) & mode=id (log below).

Would also be useful to get an example of what "JSON-stringified permissions" should look like. I used '{ "metadata": "read","contents": "read"}'

Thanks!

Run tibdex/github-app-token@v2
Error: Could not create installation access token.
    at createInstallationAccessToken (file:///home/runner/work/_actions/tibdex/github-app-token/v2/dist/main/index.js:9:86267)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async file:///home/runner/work/_actions/tibdex/github-app-token/v2/dist/main/index.js:9:875[18](https://github.com/bosch-tamer/arc-runner/actions/runs/6421442387/job/17435810580#step:2:19)
    at async run (file:///home/runner/work/_actions/tibdex/github-app-token/v2/dist/main/index.js:9:88811)
    at async file:///home/runner/work/_actions/tibdex/github-app-token/v2/dist/main/index.js:9:87468 {
  [cause]: RequestError [HttpError]: Not Found
      at file:///home/runner/work/_actions/tibdex/github-app-token/v2/dist/main/index.js:1:64431
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
      at async createInstallationAccessToken (file:///home/runner/work/_actions/tibdex/github-app-token/v2/dist/main/index.js:9:861[19](https://github.com/bosch-tamer/arc-runner/actions/runs/6421442387/job/17435810580#step:2:20))
      at async file:///home/runner/work/_actions/tibdex/github-app-token/v2/dist/main/index.js:9:87518
      at async run (file:///home/runner/work/_actions/tibdex/github-app-token/v2/dist/main/index.js:9:88811)
      at async file:///home/runner/work/_actions/tibdex/github-app-token/v2/dist/main/index.js:9:87468 {
    status: 404,
    response: {
      url: 'https://api.github.com/app/installations/[26](https://github.com/bosch-tamer/arc-runner/actions/runs/6421442387/job/17435810580#step:2:27)32/access_tokens',
      status: 404,
      headers: [Object],
      data: [Object]
    },
    request: {
      method: 'POST',
      url: 'https://api.github.com/app/installations/2632/access_tokens',
      headers: [Object],
      body: '{"permissions":{"metadata":"read","contents":"read"}}',
      request: [Object]
    }
  }
}
@vparmeland
Copy link

Same issue on my GH organization

@tibdex
Copy link
Owner

tibdex commented Oct 10, 2023

github_api_url is passed here:

const app = createAppAuth({
appId,
privateKey,
request: request.defaults({
baseUrl: githubApiUrl
.toString()
// Remove optional trailing `/`.
.replace(/\/$/, ""),
}),
});

Maybe something changed in recent versions of @octokit/auth-app and this has to be done differently.

Could one of you please take a look?

@gayanak
Copy link

gayanak commented Oct 26, 2023

image
The base url is not working as expected.

@cryptopapi997
Copy link

I had the same issue earlier, and it turned out I had created but not installed my org-specific app. Perhaps this is the issue for you as well?

Related: actions/create-github-app-token#76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants