refactor: Outsource API calls to OctokitWrapper

This commit is contained in:
Thomas A. Christensen II 2023-12-23 10:46:15 -07:00
parent 2a5cf63744
commit 2483bb745d

View file

@ -28,16 +28,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 = {}