refactor: Outsource API calls to OctokitWrapper

This commit is contained in:
Thomas A. Christensen II 2023-12-23 10:46:15 -07:00
parent 9c201e4232
commit 91a673d1c0
Signed by: millironx
GPG key ID: 09335146883990B9

View file

@ -29,16 +29,9 @@ async function run(): Promise<void> {
} }
// Setup the API // Setup the API
let octokit: InstanceType<typeof GitHub> | undefined const octokit = await setup_octokit(token)
try {
octokit = github.getOctokit(token) const releases = await pull_releases(octokit)
} catch (e: unknown) {
if (e instanceof Error) {
core.setFailed(
`Could not authenticate to GitHub Releases API with provided token\n${e.message}`
)
}
}
// Get the release info for the desired release // Get the release info for the desired release
let release = {} let release = {}