Merge pull request #1121 from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.23.0

chore(deps): Bump @docker/actions-toolkit from 0.22.0 to 0.23.0
This commit is contained in:
CrazyMax 2024-05-14 14:34:37 +02:00 committed by GitHub
commit df19a799eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 98 additions and 89 deletions

View File

@ -1,12 +1,15 @@
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
import * as fs from 'fs';
import * as path from 'path';
import {Builder} from '@docker/actions-toolkit/lib/buildx/builder';
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx';
import {Build} from '@docker/actions-toolkit/lib/buildx/build';
import {Context} from '@docker/actions-toolkit/lib/context';
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
import {GitHub} from '@docker/actions-toolkit/lib/github';
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
import {BuilderInfo} from '@docker/actions-toolkit/lib/types/builder';
import {GitHubRepo} from '@docker/actions-toolkit/lib/types/github';
@ -35,6 +38,16 @@ jest.spyOn(Docker, 'isAvailable').mockImplementation(async (): Promise<boolean>
return true;
});
const metadataJson = path.join(tmpDir, 'metadata.json');
jest.spyOn(Build.prototype, 'getMetadataFilePath').mockImplementation((): string => {
return metadataJson;
});
const imageIDFilePath = path.join(tmpDir, 'iidfile.txt');
jest.spyOn(Build.prototype, 'getImageIDFilePath').mockImplementation((): string => {
return imageIDFilePath;
});
jest.spyOn(Builder.prototype, 'inspect').mockImplementation(async (): Promise<BuilderInfo> => {
return {
name: 'builder2',
@ -78,7 +91,7 @@ describe('getArgs', () => {
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'.'
]
],
@ -101,7 +114,7 @@ ccc"`],
'--build-arg', 'MY_ARG=val1,val2,val3',
'--build-arg', 'ARG=val',
'--build-arg', `MULTILINE=aaaa\nbbbb\nccc`,
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'https://github.com/docker/build-push-action.git#refs/heads/master'
]
],
@ -117,7 +130,7 @@ ccc"`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--tag', 'name/app:7.4',
'--tag', 'name/app:latest',
'https://github.com/docker/build-push-action.git#refs/heads/master'
@ -172,7 +185,7 @@ ccc"`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'.'
]
],
@ -189,7 +202,7 @@ ccc"`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
'.'
]
@ -230,7 +243,7 @@ ccc"`],
[
'build',
'--file', './test/Dockerfile',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--platform', 'linux/amd64,linux/arm64',
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
'--builder', 'builder-git-context-2',
@ -264,7 +277,7 @@ ccc"`],
[
'build',
'--file', './test/Dockerfile',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--platform', 'linux/amd64,linux/arm64',
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
'--secret', `id=MYSECRET,src=${tmpName}`,
@ -301,7 +314,7 @@ ccc`],
[
'build',
'--file', './test/Dockerfile',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--platform', 'linux/amd64,linux/arm64',
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
'--secret', `id=MYSECRET,src=${tmpName}`,
@ -330,7 +343,7 @@ ccc`],
[
'build',
'--file', './test/Dockerfile',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--secret', `id=MY_SECRET,src=${tmpName}`,
'--builder', 'builder-git-context-2',
'--network', 'host',
@ -377,8 +390,8 @@ ccc`],
'--add-host', 'docker:10.180.0.1',
'--add-host', 'foo:10.0.0.1',
'--file', './test/Dockerfile',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--iidfile', imageIDFilePath,
'--metadata-file', metadataJson,
'--network', 'host',
'--push',
'.'
@ -406,11 +419,11 @@ nproc=3`],
'--add-host', 'foo:10.0.0.1',
'--cgroup-parent', 'foo',
'--file', './test/Dockerfile',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--shm-size', '2g',
'--ulimit', 'nofile=1024:1024',
'--ulimit', 'nproc=3',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -426,8 +439,8 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--iidfile', imageIDFilePath,
'--metadata-file', metadataJson,
'https://github.com/docker/build-push-action.git#refs/heads/master:docker'
]
],
@ -444,9 +457,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'https://github.com/docker/build-push-action.git#refs/heads/master:subdir'
]
],
@ -463,8 +476,8 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--iidfile', imageIDFilePath,
'--metadata-file', metadataJson,
'.'
]
],
@ -480,9 +493,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -499,9 +512,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--attest', `type=provenance,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -518,9 +531,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--attest', `type=provenance,mode=max,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -537,9 +550,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--attest', 'type=provenance,disabled=true',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -556,9 +569,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--attest', 'type=provenance,builder-id=foo',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -575,9 +588,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
"--output", 'type=docker',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -593,9 +606,9 @@ nproc=3`],
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--load',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -613,9 +626,9 @@ nproc=3`],
[
'build',
'--build-arg', 'FOO=bar#baz',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--load',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -635,9 +648,9 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
'build',
'--secret', 'id=MY_SECRET,env=MY_SECRET_ENV',
'--secret', 'id=ANOTHER_SECRET,env=ANOTHER_SECRET_ENV',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--load',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -656,9 +669,9 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
'build',
'--secret', 'id=MY_SECRET,env=MY_SECRET_ENV',
'--secret', 'id=ANOTHER_SECRET,env=ANOTHER_SECRET_ENV',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--load',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -678,7 +691,7 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
'build',
'--output', 'type=local,dest=./release-out',
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -702,7 +715,7 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
'--annotation', 'manifest-descriptor[linux/amd64]:example4=zzz',
'--output', 'type=local,dest=./release-out',
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -719,10 +732,10 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
"--output", `type=image,"name=localhost:5000/name/app:latest,localhost:5000/name/app:foo",push-by-digest=true,name-canonical=true,push=true`,
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -740,10 +753,10 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--attest', `type=provenance,mode=max,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--attest', `type=sbom,disabled=false`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -761,9 +774,9 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--attest', `type=provenance,mode=max,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],
@ -780,9 +793,9 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
]),
[
'build',
'--iidfile', path.join(tmpDir, 'iidfile'),
'--iidfile', imageIDFilePath,
'--attest', `type=provenance,mode=min,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'.'
]
],

8
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

19
dist/licenses.txt generated vendored
View File

@ -3855,25 +3855,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
yallist
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
zip-stream
MIT
Copyright (c) 2014 Chris Talkington, contributors.

View File

@ -27,7 +27,7 @@
"packageManager": "yarn@3.6.3",
"dependencies": {
"@actions/core": "^1.10.1",
"@docker/actions-toolkit": "0.22.0",
"@docker/actions-toolkit": "0.23.0",
"handlebars": "^4.7.7"
},
"devDependencies": {

View File

@ -136,7 +136,7 @@ async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit):
args.push('--file', inputs.file);
}
if (!Build.hasLocalExporter(inputs.outputs) && !Build.hasTarExporter(inputs.outputs) && (inputs.platforms.length == 0 || (await toolkit.buildx.versionSatisfies('>=0.4.2')))) {
args.push('--iidfile', Build.getImageIDFilePath());
args.push('--iidfile', toolkit.buildxBuild.getImageIDFilePath());
}
await Util.asyncForEach(inputs.labels, async label => {
args.push('--label', label);
@ -199,7 +199,7 @@ async function getCommonArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<st
args.push('--load');
}
if (await toolkit.buildx.versionSatisfies('>=0.6.0')) {
args.push('--metadata-file', Build.getMetadataFilePath());
args.push('--metadata-file', toolkit.buildxBuild.getMetadataFilePath());
}
if (inputs.network) {
args.push('--network', inputs.network);

View File

@ -4,7 +4,6 @@ import * as stateHelper from './state-helper';
import * as core from '@actions/core';
import * as actionsToolkit from '@docker/actions-toolkit';
import {Build} from '@docker/actions-toolkit/lib/buildx/build';
import {Context} from '@docker/actions-toolkit/lib/context';
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
import {Exec} from '@docker/actions-toolkit/lib/exec';
@ -91,9 +90,9 @@ actionsToolkit.run(
}
});
const imageID = Build.resolveImageID();
const metadata = Build.resolveMetadata();
const digest = Build.resolveDigest();
const imageID = toolkit.buildxBuild.resolveImageID();
const metadata = toolkit.buildxBuild.resolveMetadata();
const digest = toolkit.buildxBuild.resolveDigest();
if (imageID) {
await core.group(`ImageID`, async () => {

View File

@ -1055,9 +1055,9 @@ __metadata:
languageName: node
linkType: hard
"@docker/actions-toolkit@npm:0.22.0":
version: 0.22.0
resolution: "@docker/actions-toolkit@npm:0.22.0"
"@docker/actions-toolkit@npm:0.23.0":
version: 0.23.0
resolution: "@docker/actions-toolkit@npm:0.23.0"
dependencies:
"@actions/artifact": ^2.1.7
"@actions/cache": ^3.2.4
@ -1071,12 +1071,12 @@ __metadata:
"@octokit/core": ^5.1.0
"@octokit/plugin-rest-endpoint-methods": ^10.4.0
async-retry: ^1.3.3
csv-parse: ^5.5.5
csv-parse: ^5.5.6
handlebars: ^4.7.8
jwt-decode: ^4.0.0
semver: ^7.6.0
semver: ^7.6.2
tmp: ^0.2.3
checksum: 860bfe0f4b161181ffae47a9f82612b5d812b0197f582f5308fc80e8e3c55a47595134619cc7805df71a79a891fd10b6b1c4fb95c498423df1ea82a5fd84b44e
checksum: 7bac57e9d1af6214a16509051d7ac1f276880f332d44a0d52a3d9d3601204c0cbf9a23933772c5a0974e705d4295b32d036c4d37afe8965330d8f116df07faac
languageName: node
linkType: hard
@ -3113,13 +3113,20 @@ __metadata:
languageName: node
linkType: hard
"csv-parse@npm:*, csv-parse@npm:^5.5.5":
"csv-parse@npm:*":
version: 5.5.5
resolution: "csv-parse@npm:5.5.5"
checksum: 9e76b3dc3dbbf0a9b1c3529843e3891f0da23d094bdb0540a3d8f4083d00110dd545399f9cf510498def6c1fc7012cc6bc00046d281f16d705add64099467973
languageName: node
linkType: hard
"csv-parse@npm:^5.5.6":
version: 5.5.6
resolution: "csv-parse@npm:5.5.6"
checksum: ee06f97f674487dc1d001b360de8ea510a41b9d971abf43bcf9c3be22c83a3634df0d3ebfbe52fd49d145077066be7ff9f25de3fc6b71aefb973099b04147a25
languageName: node
linkType: hard
"debug@npm:4, debug@npm:^4.3.4":
version: 4.3.4
resolution: "debug@npm:4.3.4"
@ -3260,7 +3267,7 @@ __metadata:
resolution: "docker-build-push@workspace:."
dependencies:
"@actions/core": ^1.10.1
"@docker/actions-toolkit": 0.22.0
"@docker/actions-toolkit": 0.23.0
"@types/csv-parse": ^1.2.2
"@types/node": ^20.5.9
"@typescript-eslint/eslint-plugin": ^6.6.0
@ -6064,7 +6071,7 @@ __metadata:
languageName: node
linkType: hard
"semver@npm:^7.3.5, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0":
"semver@npm:^7.3.5, semver@npm:^7.5.3, semver@npm:^7.5.4":
version: 7.6.0
resolution: "semver@npm:7.6.0"
dependencies:
@ -6075,6 +6082,15 @@ __metadata:
languageName: node
linkType: hard
"semver@npm:^7.6.2":
version: 7.6.2
resolution: "semver@npm:7.6.2"
bin:
semver: bin/semver.js
checksum: 40f6a95101e8d854357a644da1b8dd9d93ce786d5c6a77227bc69dbb17bea83d0d1d1d7c4cd5920a6df909f48e8bd8a5909869535007f90278289f2451d0292d
languageName: node
linkType: hard
"shebang-command@npm:^2.0.0":
version: 2.0.0
resolution: "shebang-command@npm:2.0.0"