upload-artifact
upload-artifact copied to clipboard
DownloadArtifact via octokit (js) returns 500 if the artifact is uploaded using v4
What happened?
We have a github bot (build with probot) that downloads artifacts from completed workflows in order to post their content elsewhere.
after a "workflow_run.completed" webhook is received by this bot, it checks for any existing artifacts with a specific name for the given workflow_run and tries to download them using:
const {
data: { archive_download_url },
} = await octokit.rest.actions.getArtifact({
owner: repoOwner,
repo: repoName,
artifact_id: artifactId,
archive_format: "zip",
});
const { data: fileContent } = await octokit.request(archive_download_url);
or
const download = await octokit.rest.actions.downloadArtifact({
owner: repoOwner,
repo: repoName,
artifact_id: artifactId,
archive_format: "zip",
});
both these methods work well when the artifact is uploaded via V3.
If the artifacts are uploaded by V4 we get the following error:
{
"name": "HttpError",
"status": 500,
"request": {
"method": "GET",
"url": "https://api.github.com/repos/wixplosives/core3-bot-testbed/actions/artifacts/1779838056/zip",
"headers": {
"accept": "application/vnd.github.v3+json",
"user-agent": "probot/13.3.6 octokit-core.js/5.2.0 Node.js/20.16.0 (linux; x64)",
"x-github-delivery": "811263e0-53ca-11ef-8b73-201b4eef40fa",
"authorization": "token [REDACTED]"
},
"request": {
"retryCount": 3,
"retries": 3,
"retryAfter": 16
}
}
}
What did you expect to happen?
Would expect that the rest api would download my artifact regardless of how it was uploaded
How can we reproduce it?
Errors only occur in specific environments once our bot is deployed to our organization's cluster, no current knowledge on what exactly causes this issue.
Does not seem to happen when bot server is run locally or on github or self-hosted runners
Anything else we need to know?
The aforementioned bot is private and i can not share it here publicly.
What version of the action are you using?
v4
What are your runner environments?
self-hosted
Are you on GitHub Enterprise Server? If so, what version?
No response