Skip to content

Commit

Permalink
Increase robustness in case of GitHub API failures
Browse files Browse the repository at this point in the history
attempt to mitigate #301
  • Loading branch information
fkirc committed Dec 2, 2022
1 parent 12aca0a commit 33c9eac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/main.ts
Expand Up @@ -465,10 +465,18 @@ async function main(): Promise<void> {
const octokit = new Octokit(getOctokitOptions(token))

// Get and parse the current workflow run.
try {
const {data: apiCurrentRun} = await octokit.rest.actions.getWorkflowRun({
...repo,
run_id: github.context.runId
})
} catch (error) {
core.warning(error)
await exitSuccess({
shouldSkip: false,
reason: 'no_transferable_run'
})
}
const currentTreeHash = apiCurrentRun.head_commit?.tree_id
if (!currentTreeHash) {
exitFail(`
Expand Down

0 comments on commit 33c9eac

Please sign in to comment.