From 2020f1b15a4d1da1263b98f8f408c5e43a6685b9 Mon Sep 17 00:00:00 2001 From: Reuben Morais Date: Wed, 28 Jul 2021 14:24:11 +0200 Subject: [PATCH] Undo accidental auth removal in check_artifact_exists action --- .../check_artifact_exists/dist/index.js | Bin 1052781 -> 1053200 bytes .github/actions/check_artifact_exists/main.js | 7 +++++++ 2 files changed, 7 insertions(+) diff --git a/.github/actions/check_artifact_exists/dist/index.js b/.github/actions/check_artifact_exists/dist/index.js index 9f900b5367a2a2a73bcce5f43348590f7d4e41da..ebfdd28fd0eeaa209533919314e329871179140c 100644 GIT binary patch delta 324 zcmaF6z+u7?hYkN&l}qxoQ}YyT6_WFdQuWePOFZ)mN=r19(lbjkN|WNjvXd3r#2BqN zzh_;?$dg!Fl3}F)7S`E3f&Cxjv`b9v)8BJ*h)({%&N6ud3$KW4MMh$2aY<^5f{{W| zYDrOMYO&JfKu&2DuocCrC2onCIjJccN;njXPcD!U+B~0Alo4bk#9;_s3GSIC9;HbN zL9W3e3XTDu3X=o4Y#22s_i-w0KFrm?3euyfqmt)nK|d zq1jNN-B5rLh?#(x8Hibcm=%cGfS4VKIe?fGh`E568;E&;m=}oofS7-}p@4u509L4I AH~;_u delta 119 zcmbQR#Nq7%hYkN&H@maVXWaas{UhV#g6)En6?phJui#>1+^oRU&kE!TOn)E7%RPOK z3I}mdKF((jn0Wmia^8hg~5c2^s|8yQ90Tuw+ CqaJzy diff --git a/.github/actions/check_artifact_exists/main.js b/.github/actions/check_artifact_exists/main.js index be1559dd..abb9d440 100644 --- a/.github/actions/check_artifact_exists/main.js +++ b/.github/actions/check_artifact_exists/main.js @@ -37,6 +37,7 @@ async function getGoodArtifacts(client, owner, repo, releaseId, name) { async function main() { try { + const token = core.getInput("github_token", { required: true }); const [owner, repo] = core.getInput("repo", { required: true }).split("/"); const path = core.getInput("path", { required: true }); const name = core.getInput("name"); @@ -44,6 +45,7 @@ async function main() { const releaseTag = core.getInput("release-tag"); const OctokitWithThrottling = GitHub.plugin(throttling); const client = new OctokitWithThrottling({ + auth: token, throttle: { onRateLimit: (retryAfter, options) => { console.log( @@ -54,6 +56,9 @@ async function main() { if (options.request.retryCount <= 2) { console.log(`Retrying after ${retryAfter} seconds!`); return true; + } else { + console.log("Exhausted 2 retries"); + core.setFailed("Exhausted 2 retries"); } }, onAbuseLimit: (retryAfter, options) => { @@ -61,6 +66,7 @@ async function main() { console.log( `Abuse detected for request ${options.method} ${options.url}` ); + core.setFailed(`GitHub REST API Abuse detected for request ${options.method} ${options.url}`) }, }, }); @@ -101,6 +107,7 @@ async function main() { await Download(artifact.url, dir, { headers: { "Accept": "application/octet-stream", + "Authorization": `token ${token}`, }, }); }