bake: hasGitAuthTokenSecret func

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2025-01-10 09:14:36 +01:00
parent e36200f754
commit 73473a8d30
4 changed files with 74 additions and 0 deletions

View File

@@ -348,6 +348,7 @@ export class Bake {
secretEntry.src = value;
break;
case 'env':
secretEntry.env = value;
break;
}
}
@@ -406,4 +407,18 @@ export class Bake {
}
return exporters;
}
public static hasGitAuthTokenSecret(def: BakeDefinition): boolean {
for (const key in def.target) {
const target = def.target[key];
if (target.secret) {
for (const secret of target.secret) {
if (Bake.parseSecretEntry(secret).id === 'GIT_AUTH_TOKEN') {
return true;
}
}
}
}
return false;
}
}