ZoobDude
CDCloudflare Developers
•Created by ZoobDude on 3/1/2024 in #workers-help
Attempting to use worker to download gh artifact
anyone?
4 replies
CDCloudflare Developers
•Created by ZoobDude on 3/1/2024 in #workers-help
Attempting to use worker to download gh artifact
const owner = "";
const repo = "";
const runsResponseJson = await fetch(
https://api.github.com/repos/${owner}/${repo}/actions/runs?per_page=1&status=success
).then(x => x.json());
const artifactsResponseJson = await fetch(https://api.github.com/repos/${owner}/${repo}/actions/runs/${runsResponseJson.workflow_runs[0].id}/artifacts?name=post_image
).then(x => x.json());
console.log(artifactsResponseJson.artifacts);
const image = await fetch(artifactsResponseJson.artifacts[0].archive_download_url, {
headers: {
"Authorization": "Bearer " + "auth_token"
}
});4 replies