mirror of
https://github.com/github/codeql-action.git
synced 2025-12-30 11:10:22 +08:00
19 lines
460 B
JavaScript
19 lines
460 B
JavaScript
import { createAppAuth } from "@octokit/auth-app";
|
|
async function getInstallationOctokit(app, installationId) {
|
|
return app.octokit.auth({
|
|
type: "installation",
|
|
installationId,
|
|
factory(auth) {
|
|
const options = {
|
|
...auth.octokitOptions,
|
|
authStrategy: createAppAuth,
|
|
...{ auth: { ...auth, installationId } }
|
|
};
|
|
return new auth.octokit.constructor(options);
|
|
}
|
|
});
|
|
}
|
|
export {
|
|
getInstallationOctokit
|
|
};
|