Skip to content

Commit df19a79

Browse files
authored
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
2 parents 6003d32 + 0e2ab16 commit df19a79

File tree

8 files changed

+98
-89
lines changed

8 files changed

+98
-89
lines changed

__tests__/context.test.ts

Lines changed: 62 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
22
import * as fs from 'fs';
33
import * as path from 'path';
4+
45
import {Builder} from '@docker/actions-toolkit/lib/buildx/builder';
56
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx';
7+
import {Build} from '@docker/actions-toolkit/lib/buildx/build';
68
import {Context} from '@docker/actions-toolkit/lib/context';
79
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
810
import {GitHub} from '@docker/actions-toolkit/lib/github';
911
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
12+
1013
import {BuilderInfo} from '@docker/actions-toolkit/lib/types/builder';
1114
import {GitHubRepo} from '@docker/actions-toolkit/lib/types/github';
1215

@@ -35,6 +38,16 @@ jest.spyOn(Docker, 'isAvailable').mockImplementation(async (): Promise<boolean>
3538
return true;
3639
});
3740

41+
const metadataJson = path.join(tmpDir, 'metadata.json');
42+
jest.spyOn(Build.prototype, 'getMetadataFilePath').mockImplementation((): string => {
43+
return metadataJson;
44+
});
45+
46+
const imageIDFilePath = path.join(tmpDir, 'iidfile.txt');
47+
jest.spyOn(Build.prototype, 'getImageIDFilePath').mockImplementation((): string => {
48+
return imageIDFilePath;
49+
});
50+
3851
jest.spyOn(Builder.prototype, 'inspect').mockImplementation(async (): Promise<BuilderInfo> => {
3952
return {
4053
name: 'builder2',
@@ -78,7 +91,7 @@ describe('getArgs', () => {
7891
]),
7992
[
8093
'build',
81-
'--iidfile', path.join(tmpDir, 'iidfile'),
94+
'--iidfile', imageIDFilePath,
8295
'.'
8396
]
8497
],
@@ -101,7 +114,7 @@ ccc"`],
101114
'--build-arg', 'MY_ARG=val1,val2,val3',
102115
'--build-arg', 'ARG=val',
103116
'--build-arg', `MULTILINE=aaaa\nbbbb\nccc`,
104-
'--iidfile', path.join(tmpDir, 'iidfile'),
117+
'--iidfile', imageIDFilePath,
105118
'https://github.com/docker/build-push-action.git#refs/heads/master'
106119
]
107120
],
@@ -117,7 +130,7 @@ ccc"`],
117130
]),
118131
[
119132
'build',
120-
'--iidfile', path.join(tmpDir, 'iidfile'),
133+
'--iidfile', imageIDFilePath,
121134
'--tag', 'name/app:7.4',
122135
'--tag', 'name/app:latest',
123136
'https://github.com/docker/build-push-action.git#refs/heads/master'
@@ -172,7 +185,7 @@ ccc"`],
172185
]),
173186
[
174187
'build',
175-
'--iidfile', path.join(tmpDir, 'iidfile'),
188+
'--iidfile', imageIDFilePath,
176189
'.'
177190
]
178191
],
@@ -189,7 +202,7 @@ ccc"`],
189202
]),
190203
[
191204
'build',
192-
'--iidfile', path.join(tmpDir, 'iidfile'),
205+
'--iidfile', imageIDFilePath,
193206
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
194207
'.'
195208
]
@@ -230,7 +243,7 @@ ccc"`],
230243
[
231244
'build',
232245
'--file', './test/Dockerfile',
233-
'--iidfile', path.join(tmpDir, 'iidfile'),
246+
'--iidfile', imageIDFilePath,
234247
'--platform', 'linux/amd64,linux/arm64',
235248
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
236249
'--builder', 'builder-git-context-2',
@@ -264,7 +277,7 @@ ccc"`],
264277
[
265278
'build',
266279
'--file', './test/Dockerfile',
267-
'--iidfile', path.join(tmpDir, 'iidfile'),
280+
'--iidfile', imageIDFilePath,
268281
'--platform', 'linux/amd64,linux/arm64',
269282
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
270283
'--secret', `id=MYSECRET,src=${tmpName}`,
@@ -301,7 +314,7 @@ ccc`],
301314
[
302315
'build',
303316
'--file', './test/Dockerfile',
304-
'--iidfile', path.join(tmpDir, 'iidfile'),
317+
'--iidfile', imageIDFilePath,
305318
'--platform', 'linux/amd64,linux/arm64',
306319
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
307320
'--secret', `id=MYSECRET,src=${tmpName}`,
@@ -330,7 +343,7 @@ ccc`],
330343
[
331344
'build',
332345
'--file', './test/Dockerfile',
333-
'--iidfile', path.join(tmpDir, 'iidfile'),
346+
'--iidfile', imageIDFilePath,
334347
'--secret', `id=MY_SECRET,src=${tmpName}`,
335348
'--builder', 'builder-git-context-2',
336349
'--network', 'host',
@@ -377,8 +390,8 @@ ccc`],
377390
'--add-host', 'docker:10.180.0.1',
378391
'--add-host', 'foo:10.0.0.1',
379392
'--file', './test/Dockerfile',
380-
'--iidfile', path.join(tmpDir, 'iidfile'),
381-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
393+
'--iidfile', imageIDFilePath,
394+
'--metadata-file', metadataJson,
382395
'--network', 'host',
383396
'--push',
384397
'.'
@@ -406,11 +419,11 @@ nproc=3`],
406419
'--add-host', 'foo:10.0.0.1',
407420
'--cgroup-parent', 'foo',
408421
'--file', './test/Dockerfile',
409-
'--iidfile', path.join(tmpDir, 'iidfile'),
422+
'--iidfile', imageIDFilePath,
410423
'--shm-size', '2g',
411424
'--ulimit', 'nofile=1024:1024',
412425
'--ulimit', 'nproc=3',
413-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
426+
'--metadata-file', metadataJson,
414427
'.'
415428
]
416429
],
@@ -426,8 +439,8 @@ nproc=3`],
426439
]),
427440
[
428441
'build',
429-
'--iidfile', path.join(tmpDir, 'iidfile'),
430-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
442+
'--iidfile', imageIDFilePath,
443+
'--metadata-file', metadataJson,
431444
'https://github.com/docker/build-push-action.git#refs/heads/master:docker'
432445
]
433446
],
@@ -444,9 +457,9 @@ nproc=3`],
444457
]),
445458
[
446459
'build',
447-
'--iidfile', path.join(tmpDir, 'iidfile'),
460+
'--iidfile', imageIDFilePath,
448461
'--secret', `id=GIT_AUTH_TOKEN,src=${tmpName}`,
449-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
462+
'--metadata-file', metadataJson,
450463
'https://github.com/docker/build-push-action.git#refs/heads/master:subdir'
451464
]
452465
],
@@ -463,8 +476,8 @@ nproc=3`],
463476
]),
464477
[
465478
'build',
466-
'--iidfile', path.join(tmpDir, 'iidfile'),
467-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
479+
'--iidfile', imageIDFilePath,
480+
'--metadata-file', metadataJson,
468481
'.'
469482
]
470483
],
@@ -480,9 +493,9 @@ nproc=3`],
480493
]),
481494
[
482495
'build',
483-
'--iidfile', path.join(tmpDir, 'iidfile'),
496+
'--iidfile', imageIDFilePath,
484497
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
485-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
498+
'--metadata-file', metadataJson,
486499
'.'
487500
]
488501
],
@@ -499,9 +512,9 @@ nproc=3`],
499512
]),
500513
[
501514
'build',
502-
'--iidfile', path.join(tmpDir, 'iidfile'),
515+
'--iidfile', imageIDFilePath,
503516
'--attest', `type=provenance,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
504-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
517+
'--metadata-file', metadataJson,
505518
'.'
506519
]
507520
],
@@ -518,9 +531,9 @@ nproc=3`],
518531
]),
519532
[
520533
'build',
521-
'--iidfile', path.join(tmpDir, 'iidfile'),
534+
'--iidfile', imageIDFilePath,
522535
'--attest', `type=provenance,mode=max,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
523-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
536+
'--metadata-file', metadataJson,
524537
'.'
525538
]
526539
],
@@ -537,9 +550,9 @@ nproc=3`],
537550
]),
538551
[
539552
'build',
540-
'--iidfile', path.join(tmpDir, 'iidfile'),
553+
'--iidfile', imageIDFilePath,
541554
'--attest', 'type=provenance,disabled=true',
542-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
555+
'--metadata-file', metadataJson,
543556
'.'
544557
]
545558
],
@@ -556,9 +569,9 @@ nproc=3`],
556569
]),
557570
[
558571
'build',
559-
'--iidfile', path.join(tmpDir, 'iidfile'),
572+
'--iidfile', imageIDFilePath,
560573
'--attest', 'type=provenance,builder-id=foo',
561-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
574+
'--metadata-file', metadataJson,
562575
'.'
563576
]
564577
],
@@ -575,9 +588,9 @@ nproc=3`],
575588
]),
576589
[
577590
'build',
578-
'--iidfile', path.join(tmpDir, 'iidfile'),
591+
'--iidfile', imageIDFilePath,
579592
"--output", 'type=docker',
580-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
593+
'--metadata-file', metadataJson,
581594
'.'
582595
]
583596
],
@@ -593,9 +606,9 @@ nproc=3`],
593606
]),
594607
[
595608
'build',
596-
'--iidfile', path.join(tmpDir, 'iidfile'),
609+
'--iidfile', imageIDFilePath,
597610
'--load',
598-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
611+
'--metadata-file', metadataJson,
599612
'.'
600613
]
601614
],
@@ -613,9 +626,9 @@ nproc=3`],
613626
[
614627
'build',
615628
'--build-arg', 'FOO=bar#baz',
616-
'--iidfile', path.join(tmpDir, 'iidfile'),
629+
'--iidfile', imageIDFilePath,
617630
'--load',
618-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
631+
'--metadata-file', metadataJson,
619632
'.'
620633
]
621634
],
@@ -635,9 +648,9 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
635648
'build',
636649
'--secret', 'id=MY_SECRET,env=MY_SECRET_ENV',
637650
'--secret', 'id=ANOTHER_SECRET,env=ANOTHER_SECRET_ENV',
638-
'--iidfile', path.join(tmpDir, 'iidfile'),
651+
'--iidfile', imageIDFilePath,
639652
'--load',
640-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
653+
'--metadata-file', metadataJson,
641654
'.'
642655
]
643656
],
@@ -656,9 +669,9 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
656669
'build',
657670
'--secret', 'id=MY_SECRET,env=MY_SECRET_ENV',
658671
'--secret', 'id=ANOTHER_SECRET,env=ANOTHER_SECRET_ENV',
659-
'--iidfile', path.join(tmpDir, 'iidfile'),
672+
'--iidfile', imageIDFilePath,
660673
'--load',
661-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
674+
'--metadata-file', metadataJson,
662675
'.'
663676
]
664677
],
@@ -678,7 +691,7 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
678691
'build',
679692
'--output', 'type=local,dest=./release-out',
680693
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
681-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
694+
'--metadata-file', metadataJson,
682695
'.'
683696
]
684697
],
@@ -702,7 +715,7 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
702715
'--annotation', 'manifest-descriptor[linux/amd64]:example4=zzz',
703716
'--output', 'type=local,dest=./release-out',
704717
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
705-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
718+
'--metadata-file', metadataJson,
706719
'.'
707720
]
708721
],
@@ -719,10 +732,10 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
719732
]),
720733
[
721734
'build',
722-
'--iidfile', path.join(tmpDir, 'iidfile'),
735+
'--iidfile', imageIDFilePath,
723736
"--output", `type=image,"name=localhost:5000/name/app:latest,localhost:5000/name/app:foo",push-by-digest=true,name-canonical=true,push=true`,
724737
'--attest', `type=provenance,mode=min,inline-only=true,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
725-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
738+
'--metadata-file', metadataJson,
726739
'.'
727740
]
728741
],
@@ -740,10 +753,10 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
740753
]),
741754
[
742755
'build',
743-
'--iidfile', path.join(tmpDir, 'iidfile'),
756+
'--iidfile', imageIDFilePath,
744757
'--attest', `type=provenance,mode=max,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
745758
'--attest', `type=sbom,disabled=false`,
746-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
759+
'--metadata-file', metadataJson,
747760
'.'
748761
]
749762
],
@@ -761,9 +774,9 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
761774
]),
762775
[
763776
'build',
764-
'--iidfile', path.join(tmpDir, 'iidfile'),
777+
'--iidfile', imageIDFilePath,
765778
'--attest', `type=provenance,mode=max,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
766-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
779+
'--metadata-file', metadataJson,
767780
'.'
768781
]
769782
],
@@ -780,9 +793,9 @@ ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
780793
]),
781794
[
782795
'build',
783-
'--iidfile', path.join(tmpDir, 'iidfile'),
796+
'--iidfile', imageIDFilePath,
784797
'--attest', `type=provenance,mode=min,builder-id=https://github.com/docker/build-push-action/actions/runs/123456789`,
785-
'--metadata-file', path.join(tmpDir, 'metadata-file'),
798+
'--metadata-file', metadataJson,
786799
'.'
787800
]
788801
],

dist/index.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/licenses.txt

Lines changed: 0 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"packageManager": "[email protected]",
2828
"dependencies": {
2929
"@actions/core": "^1.10.1",
30-
"@docker/actions-toolkit": "0.22.0",
30+
"@docker/actions-toolkit": "0.23.0",
3131
"handlebars": "^4.7.7"
3232
},
3333
"devDependencies": {

0 commit comments

Comments
 (0)