MCPcopy Create free account
hub / github.com/react/react / getArtifact

Function getArtifact

scripts/release/shared-commands/download-build-artifacts.js:67–85  ·  view source on GitHub ↗
(workflowRunId, artifactName)

Source from the content-addressed store, hash-verified

65}
66
67async 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
87async function processArtifact(artifact, opts) {
88 // Download and extract artifact

Callers 1

Calls 3

execFunction · 0.85
exitMethod · 0.80
findMethod · 0.65

Tested by

no test coverage detected