mirror of
https://github.com/docker/build-push-action.git
synced 2025-04-21 18:56:45 +00:00
Handle multi-line secret value
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
9c13ff40b3
commit
1471dfb80d
7 changed files with 409 additions and 39 deletions
|
@ -1,7 +1,8 @@
|
|||
import csvparse from 'csv-parse/lib/sync';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import csvparse from 'csv-parse/lib/sync';
|
||||
import * as semver from 'semver';
|
||||
|
||||
import * as context from './context';
|
||||
import * as exec from './exec';
|
||||
|
||||
|
@ -21,6 +22,9 @@ export async function getSecret(kvp: string): Promise<string> {
|
|||
const delimiterIndex = kvp.indexOf('=');
|
||||
const key = kvp.substring(0, delimiterIndex);
|
||||
const value = kvp.substring(delimiterIndex + 1);
|
||||
if (key.length == 0 || value.length == 0) {
|
||||
throw new Error(`${kvp} is not a valid secret`);
|
||||
}
|
||||
const secretFile = context.tmpNameSync({
|
||||
tmpdir: context.tmpDir()
|
||||
});
|
||||
|
@ -33,7 +37,7 @@ export function isLocalOrTarExporter(outputs: string[]): Boolean {
|
|||
delimiter: ',',
|
||||
trim: true,
|
||||
columns: false,
|
||||
relax_column_count: true
|
||||
relaxColumnCount: true
|
||||
})) {
|
||||
// Local if no type is defined
|
||||
// https://github.com/docker/buildx/blob/d2bf42f8b4784d83fde17acb3ed84703ddc2156b/build/output.go#L29-L43
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue