bake: hasGitAuthTokenSecret func
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user