How to get access token for a github app installed in a different organization? #2566
Unanswered
harshtrivedi134
asked this question in
Q&A
Replies: 1 comment 5 replies
-
If you know the repository, you can use the const { data: installationRepoA } = await app.octokit.request("GET /repos/{owner}/{repo}/installation", { owner: ownerA, repo: repoA })
const { data: installationRepoB } = await app.octokit.request("GET /repos/{owner}/{repo}/installation", { owner: ownerB, repo: repoB })
const installactionOctokitA = await app.getInstallationOctokit(installationRepoA.id)
const installactionOctokitB = await app.getInstallationOctokit(installationRepoA.id)
// use `installactionOctokitA` to read the source file, and `installactionOctokitB` to write the target file |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am currently working on developing a GitHub workflow utilizing Octokit. My goal is to synchronize files from one repository, Repo A (hosted on github.com), to another repository, Repo B (hosted on GitHub Enterprise). These repositories belong to different organizations.
The workflow is running within Repo A, and I am attempting to obtain the access token of the GitHub App installed in the organization of Repo B. My question is: How can I achieve this using the app-client?
Thank you in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions