stash/restore: add retry-count and fail-on-download inputs#715
Closed
potiuk wants to merge 1 commit intoapache:mainfrom
Closed
stash/restore: add retry-count and fail-on-download inputs#715potiuk wants to merge 1 commit intoapache:mainfrom
potiuk wants to merge 1 commit intoapache:mainfrom
Conversation
Add retry-count input (default 3) that retries `gh run download` when it exits with code 1, and fail-on-download input (default false) that makes the step fail when the download did not succeed. Also disable errexit in the Download Stash script so a single failing command cannot abort the step, and fix the previous `|| download=failed && download=success` one-liner that always reported success regardless of the download result.
Member
Author
|
will open it from main repo to test |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
retry-countinput (default3) tostash/restore/action.yml. Whengh run downloadexits with code1(the transient failure mode observed for artifact downloads), the download is retried up toretry-counttimes. Other exit codes are not retried.fail-on-downloadinput (defaultfalse). Whentrue, the step fails if the stash artifact was found but could not be downloaded after exhausting retries. Whenfalse, the failure is reported only via thestash-hitoutput.set -eo pipefail(the default GitHub Actions bash shell): callset +eup front so a single failing command cannot abort the step, and handle exit codes explicitly via$?.|| download="failed" && download="success"one-liner, which due to||/&&precedence always reportedsuccessregardless of whether the download actually worked.Test plan
stash/restoreagainst a valid stash and confirm the artifact is downloaded on the first attempt andstash-hitistrue.gh run downloadfailure (exit 1) and confirm the action retries up toretry-counttimes.fail-on-download: trueagainst a known-broken download and confirm the step fails with the error annotation.fail-on-download: false(default) against a known-broken download and confirm the step succeeds withstash-hit=false.Generated-by: Claude Opus 4.6 (1M context)