(workflowRunId, artifactName)
| 65 | } |
| 66 | |
| 67 | async function getArtifact(workflowRunId, artifactName) { |
| 68 | const res = await exec( |
| 69 | `curl -L ${GITHUB_HEADERS} https://api.github.com/repos/${REPO}/actions/runs/${workflowRunId}/artifacts?per_page=100&name=${artifactName}` |
| 70 | ); |
| 71 | |
| 72 | const json = JSON.parse(res.stdout); |
| 73 | const artifact = json.artifacts.find( |
| 74 | _artifact => _artifact.name === artifactName |
| 75 | ); |
| 76 | |
| 77 | if (artifact == null) { |
| 78 | console.log( |
| 79 | theme`{error The specified workflow run (${workflowRunId}) does not contain any build artifacts.}` |
| 80 | ); |
| 81 | process.exit(1); |
| 82 | } |
| 83 | |
| 84 | return artifact; |
| 85 | } |
| 86 | |
| 87 | async function processArtifact(artifact, opts) { |
| 88 | // Download and extract artifact |
no test coverage detected