mirror of
https://github.com/docker/login-action.git
synced 2025-01-23 14:16:26 +00:00
Also retry 408
Co-authored-by: Michael Bowyer <mbowyer@umich.edu> Signed-off-by: Fedor Dikarev <fedor.dikarev@gmail.com>
This commit is contained in:
parent
087884b3d2
commit
e7e48d6a8b
@ -51,7 +51,12 @@ export async function loginStandard(registry: string, username: string, password
|
||||
}).then(res => {
|
||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||
let isRetriable: boolean
|
||||
isRetriable = res.stderr.trim().endsWith("502 Bad Gateway")
|
||||
function isRetriableError(stderr: string): boolean {
|
||||
const trimmedError = stderr.trim();
|
||||
return trimmedError.endsWith("502 Bad Gateway") || trimmedError.includes("408");
|
||||
}
|
||||
|
||||
isRetriable = isRetriableError(res.stderr);
|
||||
if (!isRetriable || (attempt >= attempts) {
|
||||
throw new Error(res.stderr.trim());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user