Skip to content

Commit

Permalink
Merge pull request #207 from docker/dependabot/npm_and_yarn/docker/ac…
Browse files Browse the repository at this point in the history
…tions-toolkit-0.23.0

chore(deps): Bump @docker/actions-toolkit from 0.22.0 to 0.23.0
  • Loading branch information
crazy-max authored May 14, 2024
2 parents ea5f9ae + fc16f00 commit b38d33d
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 53 deletions.
29 changes: 17 additions & 12 deletions __tests__/context.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ jest.spyOn(Docker, 'isAvailable').mockImplementation(async (): Promise<boolean>
return true;
});

const metadataJson = path.join(tmpDir, 'metadata.json');
jest.spyOn(Bake.prototype, 'getMetadataFilePath').mockImplementation((): string => {
return metadataJson;
});

jest.spyOn(Builder.prototype, 'inspect').mockImplementation(async (): Promise<BuilderInfo> => {
return {
name: 'builder2',
Expand Down Expand Up @@ -152,7 +157,7 @@ describe('getArgs', () => {
]),
[
'bake',
'--metadata-file', path.join(tmpDir, 'metadata-file')
'--metadata-file', metadataJson
]
],
[
Expand All @@ -167,7 +172,7 @@ describe('getArgs', () => {
]),
[
'bake',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'webapp', 'validate'
]
],
Expand All @@ -185,7 +190,7 @@ describe('getArgs', () => {
'bake',
'--set', '*.cache-from=type=gha',
'--set', '*.cache-to=type=gha',
'--metadata-file', path.join(tmpDir, 'metadata-file')
'--metadata-file', metadataJson
]
],
[
Expand All @@ -199,7 +204,7 @@ describe('getArgs', () => {
]),
[
'bake',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
"--provenance", `mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
]
],
Expand All @@ -215,7 +220,7 @@ describe('getArgs', () => {
]),
[
'bake',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
"--provenance", `builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`
]
],
Expand All @@ -231,7 +236,7 @@ describe('getArgs', () => {
]),
[
'bake',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
"--provenance", `mode=max,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`
]
],
Expand All @@ -247,7 +252,7 @@ describe('getArgs', () => {
]),
[
'bake',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
"--provenance", 'false'
]
],
Expand All @@ -263,7 +268,7 @@ describe('getArgs', () => {
]),
[
'bake',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
"--provenance", 'builder-id=foo'
]
],
Expand All @@ -282,7 +287,7 @@ describe('getArgs', () => {
'bake',
'--set', '*.platform=linux/amd64,linux/ppc64le,linux/s390x',
'--set', `*.output=type=image,"name=moby/buildkit:v0.11.0,moby/buildkit:latest",push=true`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'--provenance', `mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'image-all'
]
Expand All @@ -301,7 +306,7 @@ describe('getArgs', () => {
[
'bake',
'--set', `*.labels.foo=bar=#baz`,
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'--provenance', `mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
'image-all'
]
Expand All @@ -321,7 +326,7 @@ describe('getArgs', () => {
'bake',
'https://github.com/docker/build-push-action.git#refs/heads/master',
'--file', './foo.hcl',
'--metadata-file', path.join(tmpDir, 'metadata-file'),
'--metadata-file', metadataJson,
'--provenance', `mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
]
],
Expand All @@ -336,7 +341,7 @@ describe('getArgs', () => {
return buildxVersion;
});
const inp = await context.getInputs();
const definition = await toolkit.bake.getDefinition(
const definition = await toolkit.buildxBake.getDefinition(
{
files: inp.files,
load: inp.load,
Expand Down
8 changes: 4 additions & 4 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

19 changes: 0 additions & 19 deletions dist/licenses.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"packageManager": "[email protected]",
"dependencies": {
"@actions/core": "^1.10.1",
"@docker/actions-toolkit": "^0.22.0",
"@docker/actions-toolkit": "^0.23.0",
"handlebars": "^4.7.8"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ async function getBakeArgs(inputs: Inputs, definition: BakeDefinition, toolkit:
args.push('--set', set);
});
if (await toolkit.buildx.versionSatisfies('>=0.6.0')) {
args.push('--metadata-file', Bake.getMetadataFilePath());
args.push('--metadata-file', toolkit.buildxBake.getMetadataFilePath());
}
if (await toolkit.buildx.versionSatisfies('>=0.10.0')) {
if (inputs.provenance) {
Expand Down
5 changes: 2 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as path from 'path';
import * as core from '@actions/core';
import * as actionsToolkit from '@docker/actions-toolkit';

import {Bake} from '@docker/actions-toolkit/lib/buildx/bake';
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';
Expand Down Expand Up @@ -78,7 +77,7 @@ actionsToolkit.run(

let definition: BakeDefinition | undefined;
await core.group(`Parsing raw definition`, async () => {
definition = await toolkit.bake.getDefinition(
definition = await toolkit.buildxBake.getDefinition(
{
files: inputs.files,
load: inputs.load,
Expand Down Expand Up @@ -125,7 +124,7 @@ actionsToolkit.run(
}
});

const metadata = Bake.resolveMetadata();
const metadata = toolkit.buildxBake.resolveMetadata();
if (metadata) {
await core.group(`Metadata`, async () => {
const metadatadt = JSON.stringify(metadata, null, 2);
Expand Down
33 changes: 21 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1048,9 +1048,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
Expand All @@ -1064,12 +1064,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

Expand Down Expand Up @@ -3123,10 +3123,10 @@ __metadata:
languageName: node
linkType: hard

"csv-parse@npm:^5.5.5":
version: 5.5.5
resolution: "csv-parse@npm:5.5.5"
checksum: 9e76b3dc3dbbf0a9b1c3529843e3891f0da23d094bdb0540a3d8f4083d00110dd545399f9cf510498def6c1fc7012cc6bc00046d281f16d705add64099467973
"csv-parse@npm:^5.5.6":
version: 5.5.6
resolution: "csv-parse@npm:5.5.6"
checksum: ee06f97f674487dc1d001b360de8ea510a41b9d971abf43bcf9c3be22c83a3634df0d3ebfbe52fd49d145077066be7ff9f25de3fc6b71aefb973099b04147a25
languageName: node
linkType: hard

Expand Down Expand Up @@ -3258,7 +3258,7 @@ __metadata:
resolution: "docker-buildx-bake@workspace:."
dependencies:
"@actions/core": ^1.10.1
"@docker/actions-toolkit": ^0.22.0
"@docker/actions-toolkit": ^0.23.0
"@types/node": ^20.5.9
"@typescript-eslint/eslint-plugin": ^6.6.0
"@typescript-eslint/parser": ^6.6.0
Expand Down Expand Up @@ -6000,7 +6000,7 @@ __metadata:
languageName: node
linkType: hard

"semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4, semver@npm:^7.6.0":
"semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.5.3, semver@npm:^7.5.4":
version: 7.6.0
resolution: "semver@npm:7.6.0"
dependencies:
Expand All @@ -6011,6 +6011,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"
Expand Down

0 comments on commit b38d33d

Please sign in to comment.