diff --git a/.github/actions-scripts/purge-old-workflow-runs.js b/.github/actions-scripts/purge-old-workflow-runs.js index c1963e909c..2692ae441f 100755 --- a/.github/actions-scripts/purge-old-workflow-runs.js +++ b/.github/actions-scripts/purge-old-workflow-runs.js @@ -193,6 +193,10 @@ async function deleteWorkflowRuns( assert(status === 204, `Unexpected status deleting logs for run ${run.id}: ${status}`) } catch (error) { console.warn('ERROR trying to delete the logs for run', run.id, error.message) + if (error.message && error.message.includes('API rate limit exceeded')) { + // This can not be recovered by continuing on to the next run. + break + } } } @@ -209,6 +213,10 @@ async function deleteWorkflowRuns( assert(status === 204, `Unexpected status deleting logs for run ${run.id}: ${status}`) } catch (error) { console.warn('ERROR trying to delete run', run.id, error.message) + if (error.message && error.message.includes('API rate limit exceeded')) { + // This can not be recovered by continuing on to the next run. + break + } } }