Open
Description
Describe the enhancement
downloadArtifact
function does not retry if GitHub API returned an error such as status 500. This is because the Octokit client is hardcoded as below:
toolkit/packages/artifact/src/internal/download/download-artifact.ts
Lines 131 to 147 in 1b1e815
It would be nice if downloadArtifact
function supports an option to pass an Octokit client. Here is an example snippet:
import * as github from '@actions/github'
import { retry } from '@octokit/plugin-retry'
import { DefaultArtifactClient } from '@actions/artifact'
const example = () => {
const octokit = github.getOctokit(token, {}, retry)
const artifactClient = new DefaultArtifactClient()
artifactClient.downloadArtifact(artifactId, {
path: 'example-directory',
findBy: {
workflowRunId: workflowRunId,
repositoryOwner: github.context.repo.owner,
repositoryName: github.context.repo.repo,
octokit: octokit,
},
})
}