mirror of
https://github.com/docker/login-action.git
synced 2025-11-11 20:46:20 +08:00
Compare commits
1 Commits
d8d0858a3d
...
98b2971c0d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98b2971c0d |
@@ -51,12 +51,7 @@ export async function loginStandard(registry: string, username: string, password
|
|||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
let isRetriable: boolean
|
let isRetriable: boolean
|
||||||
function isRetriableError(stderr: string): boolean {
|
isRetriable = res.stderr.trim().endsWith("502 Bad Gateway")
|
||||||
const trimmedError = stderr.trim();
|
|
||||||
return trimmedError.endsWith("502 Bad Gateway") || trimmedError.includes("408");
|
|
||||||
}
|
|
||||||
|
|
||||||
isRetriable = isRetriableError(res.stderr);
|
|
||||||
if (!isRetriable || (attempt >= attempts) {
|
if (!isRetriable || (attempt >= attempts) {
|
||||||
throw new Error(res.stderr.trim());
|
throw new Error(res.stderr.trim());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user