Skip to content

Commit

Permalink
Merge pull request #670 from XeroAPI/OAS-version-update-6.3.0
Browse files Browse the repository at this point in the history
OAS version update - 6.3.0
  • Loading branch information
xero-public-bot[bot] authored Oct 7, 2024
2 parents 5c916cb + 1ef65f5 commit 8d32f3d
Show file tree
Hide file tree
Showing 359 changed files with 195,933 additions and 40,853 deletions.
27 changes: 27 additions & 0 deletions .github/octokit/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {Octokit} from "@octokit/rest";
import {createAppAuth} from "@octokit/auth-app"

export const getAccessToken = async () => {

const {GITHUB_APP_ID, GITHUB_APP_PRIVATE_KEY} = process.env

const octoKitInstance = new Octokit({
authStrategy: createAppAuth,
auth: {
appId: GITHUB_APP_ID,
privateKey: GITHUB_APP_PRIVATE_KEY
}
});

const {data: installations} = await octoKitInstance.rest.apps.listInstallations()

if(!installations.length) {
throw new Error("No Installations found for this github app")
}

const installationId = installations[0].id;

const installationAccessToken = await octoKitInstance.rest.apps.createInstallationAccessToken({installation_id: installationId})

return installationAccessToken.data.token
}
253 changes: 253 additions & 0 deletions .github/octokit/node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions .github/octokit/node_modules/@octokit/auth-app/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8d32f3d

Please sign in to comment.