Add configurable timeout and retry for git network operations

Add per-attempt timeout (default 300s) and Kubernetes probe-style retry
configuration for git fetch, lfs-fetch, and ls-remote. New action inputs:
timeout, retry-max-attempts, retry-min-backoff, retry-max-backoff.

Fixes https://github.com/actions/checkout/issues/631

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Anatoly Rabkin 2026-03-18 18:06:25 +02:00
parent 0c366fd6a8
commit 5df58a66d1
10 changed files with 342 additions and 81 deletions

View file

@ -155,6 +155,28 @@ Please refer to the [release page](https://github.com/actions/checkout/releases/
# Default: true
set-safe-directory: ''
# Timeout in seconds for each git network operation attempt (fetch, lfs-fetch,
# ls-remote). If a single attempt exceeds this, it is killed and retried. Set to 0
# to disable. Default is 300 (5 minutes). Similar to Kubernetes probe
# timeoutSeconds.
# Default: 300
timeout: ''
# Maximum number of retry attempts for failed git network operations. Similar to
# Kubernetes probe failureThreshold.
# Default: 3
retry-max-attempts: ''
# Minimum backoff time in seconds between retry attempts. The actual backoff is
# randomly chosen between min and max. Similar to Kubernetes probe periodSeconds.
# Default: 10
retry-min-backoff: ''
# Maximum backoff time in seconds between retry attempts. The actual backoff is
# randomly chosen between min and max.
# Default: 20
retry-max-backoff: ''
# The base URL for the GitHub instance that you are trying to clone from, will use
# environment defaults to fetch from the same instance that the workflow is
# running from unless specified. Example URLs are https://github.com or