Local if no type is defined for output

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2020-10-20 17:53:03 +02:00
parent bf051e6237
commit 6751eb6bd5
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
4 changed files with 11 additions and 2 deletions

View File

@ -80,7 +80,7 @@ describe('isLocalOrTarExporter', () => {
[
'.'
],
false
true
],
])(
'given %p returns %p',

View File

@ -95,7 +95,6 @@ describe('getArgs', () => {
'buildx',
'build',
'--output', '.',
'--iidfile', '/tmp/.docker-build-push-jest/iidfile',
'--secret', 'id=GIT_AUTH_TOKEN,src=/tmp/.docker-build-push-jest/.tmpname-jest',
'--file', 'Dockerfile',
'https://github.com/docker/build-push-action.git#test-jest'

5
dist/index.js generated vendored
View File

@ -5368,6 +5368,11 @@ function isLocalOrTarExporter(outputs) {
columns: false,
relax_column_count: true
})) {
// Local if no type is defined
// https://github.com/docker/buildx/blob/d2bf42f8b4784d83fde17acb3ed84703ddc2156b/build/output.go#L29-L43
if (output.length == 1 && !output[0].startsWith('type=')) {
return true;
}
for (let [key, value] of output.map(chunk => chunk.split('=').map(item => item.trim()))) {
if (key == 'type' && (value == 'local' || value == 'tar')) {
return true;

View File

@ -33,6 +33,11 @@ export function isLocalOrTarExporter(outputs: string[]): Boolean {
columns: false,
relax_column_count: true
})) {
// Local if no type is defined
// https://github.com/docker/buildx/blob/d2bf42f8b4784d83fde17acb3ed84703ddc2156b/build/output.go#L29-L43
if (output.length == 1 && !output[0].startsWith('type=')) {
return true;
}
for (let [key, value] of output.map(chunk => chunk.split('=').map(item => item.trim()))) {
if (key == 'type' && (value == 'local' || value == 'tar')) {
return true;