From d963a29e657d0edf036d9ccc7bb1bb1604662613 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 10:55:02 +0000 Subject: [PATCH 1/3] Initial plan From 943887c0aabcc538847112ee18043ff9cff5a49d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 10:57:23 +0000 Subject: [PATCH 2/3] Add retry with exponential backoff to artifact cache restore action Co-authored-by: phlax <454682+phlax@users.noreply.github.com> --- .../github/artifact/cache/restore/action.yml | 34 ++++++++++++++----- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/actions/github/artifact/cache/restore/action.yml b/actions/github/artifact/cache/restore/action.yml index 9842dc7aa0..d55f79e196 100644 --- a/actions/github/artifact/cache/restore/action.yml +++ b/actions/github/artifact/cache/restore/action.yml @@ -40,15 +40,31 @@ runs: || steps.cache-id.outputs.id shell: bash run: | - gh api \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - "/repos/${REPOSITORY}/actions/artifacts/${ARTIFACT_ID}/zip" \ - | tar --warning=no-timestamp \ - --keep-directory-symlink \ - -xI unzstd \ - -f - \ - -C ${OUTPUT_PATH} + MAX_RETRIES=3 + RETRY_DELAY=10 + for attempt in $(seq 1 "$MAX_RETRIES"); do + echo "Attempt $attempt of $MAX_RETRIES" + if gh api \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "/repos/${REPOSITORY}/actions/artifacts/${ARTIFACT_ID}/zip" \ + | tar --warning=no-timestamp \ + --keep-directory-symlink \ + -xI unzstd \ + -f - \ + -C ${OUTPUT_PATH}; then + echo "Cache restored successfully" + exit 0 + fi + if [[ "$attempt" -lt "$MAX_RETRIES" ]]; then + echo "::warning::Attempt $attempt failed, retrying in ${RETRY_DELAY}s..." + find "${OUTPUT_PATH:?}" -mindepth 1 -delete + sleep "$RETRY_DELAY" + fi + RETRY_DELAY=$((RETRY_DELAY * 2)) + done + echo "::error::Failed to restore artifact cache after $MAX_RETRIES attempts" + exit 1 env: GH_TOKEN: ${{ inputs.token }} ARTIFACT_ID: ${{ inputs.id || steps.cache-id.outputs.id }} From 347b26ea1a260252cc65a7d57bbe5e638d2df544 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 27 Feb 2026 11:03:45 +0000 Subject: [PATCH 3/3] Move MAX_RETRIES and RETRY_DELAY to action inputs passed via env Co-authored-by: phlax <454682+phlax@users.noreply.github.com> --- actions/github/artifact/cache/restore/action.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/actions/github/artifact/cache/restore/action.yml b/actions/github/artifact/cache/restore/action.yml index d55f79e196..f4c110b2f2 100644 --- a/actions/github/artifact/cache/restore/action.yml +++ b/actions/github/artifact/cache/restore/action.yml @@ -20,6 +20,14 @@ inputs: wf-path: type: string required: true + max-retries: + type: number + required: false + default: 3 + retry-delay: + type: number + required: false + default: 10 runs: @@ -40,8 +48,6 @@ runs: || steps.cache-id.outputs.id shell: bash run: | - MAX_RETRIES=3 - RETRY_DELAY=10 for attempt in $(seq 1 "$MAX_RETRIES"); do echo "Attempt $attempt of $MAX_RETRIES" if gh api \ @@ -70,3 +76,5 @@ runs: ARTIFACT_ID: ${{ inputs.id || steps.cache-id.outputs.id }} OUTPUT_PATH: ${{ inputs.path }} REPOSITORY: ${{ inputs.repository }} + MAX_RETRIES: ${{ inputs.max-retries }} + RETRY_DELAY: ${{ inputs.retry-delay }}