( octokit: ReturnType<typeof authGithub>, )
| 29 | }; |
| 30 | |
| 31 | export const getGithubToken = async ( |
| 32 | octokit: ReturnType<typeof authGithub>, |
| 33 | ) => { |
| 34 | const installation = (await octokit.auth({ |
| 35 | type: "installation", |
| 36 | })) as { |
| 37 | token: string; |
| 38 | }; |
| 39 | |
| 40 | return installation.token; |
| 41 | }; |
| 42 | |
| 43 | /** |
| 44 | * Check if a GitHub user has write/admin permissions on a repository |
no outgoing calls
no test coverage detected