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

@ -1146,7 +1146,9 @@ async function setup(testName: string): Promise<void> {
}
),
tryReset: jest.fn(),
version: jest.fn()
version: jest.fn(),
setTimeout: jest.fn(),
setRetryConfig: jest.fn()
}
settings = {
@ -1173,7 +1175,11 @@ async function setup(testName: string): Promise<void> {
sshUser: '',
workflowOrganizationId: 123456,
setSafeDirectory: true,
githubServerUrl: githubServerUrl
githubServerUrl: githubServerUrl,
timeout: 300,
retryMaxAttempts: 3,
retryMinBackoff: 10,
retryMaxBackoff: 20
}
}

View file

@ -506,6 +506,8 @@ async function setup(testName: string): Promise<void> {
tryReset: jest.fn(async () => {
return true
}),
version: jest.fn()
version: jest.fn(),
setTimeout: jest.fn(),
setRetryConfig: jest.fn()
}
}