Compare commits

...

4 Commits

Author SHA1 Message Date
CrazyMax
4d926d8b7b Merge pull request #1015 from docker/dependabot/npm_and_yarn/actions/artifact-6.2.1
Some checks failed
publish / publish (push) Has been cancelled
build(deps): bump @actions/artifact from 6.2.0 to 6.2.1
2026-03-13 11:19:34 +01:00
dependabot[bot]
293c3cdcfe build(deps): bump @actions/artifact from 6.2.0 to 6.2.1
Bumps [@actions/artifact](https://github.com/actions/toolkit/tree/HEAD/packages/artifact) from 6.2.0 to 6.2.1.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/artifact/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/artifact)

---
updated-dependencies:
- dependency-name: "@actions/artifact"
  dependency-version: 6.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-11 22:53:45 +00:00
CrazyMax
17071615a7 Merge pull request #1014 from crazy-max/imagetools-annotations
buildx(imagetools): add annotations support for create command
2026-03-10 12:22:44 +01:00
CrazyMax
0cc9e68b03 buildx(imagetools): add annotations support for create command
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2026-03-10 12:06:12 +01:00
5 changed files with 49 additions and 6 deletions

View File

@@ -117,6 +117,43 @@ describe('create', () => {
expect(result).toBeUndefined();
});
it('passes annotations to imagetools create', async () => {
const getCommand = vi.fn().mockResolvedValue({
command: 'docker',
args: ['buildx', 'imagetools', 'create']
});
const buildx = {getCommand} as unknown as Buildx;
const execSpy = vi.spyOn(Exec, 'getExecOutput').mockResolvedValue({
exitCode: 0,
stdout: '',
stderr: ''
});
const result = await new ImageTools({buildx}).create({
sources: ['docker.io/library/alpine:latest'],
annotations: ['index:org.opencontainers.image.title=Alpine', 'manifest-descriptor:org.opencontainers.image.description=Base image'],
silent: true
});
expect(getCommand).toHaveBeenCalledWith([
'imagetools',
'create',
'--annotation',
'index:org.opencontainers.image.title=Alpine',
'--annotation',
'manifest-descriptor:org.opencontainers.image.description=Base image',
'--metadata-file',
metadataFile,
'docker.io/library/alpine:latest'
]);
expect(execSpy).toHaveBeenCalledWith('docker', ['buildx', 'imagetools', 'create'], {
ignoreReturnCode: true,
silent: true
});
expect(result).toBeUndefined();
});
it('skips command execution when skipExec is enabled', async () => {
const getCommand = vi.fn().mockResolvedValue({
command: 'docker',

View File

@@ -42,7 +42,7 @@
"registry": "https://registry.npmjs.org/"
},
"dependencies": {
"@actions/artifact": "^6.2.0",
"@actions/artifact": "^6.2.1",
"@actions/cache": "^6.0.0",
"@actions/core": "^3.0.0",
"@actions/exec": "^3.0.0",

View File

@@ -153,6 +153,11 @@ export class ImageTools {
args.push('--platform', platform);
}
}
if (opts.annotations) {
for (const annotation of opts.annotations) {
args.push('--annotation', annotation);
}
}
if (opts.dryRun) {
args.push('--dry-run');
} else {

View File

@@ -32,6 +32,7 @@ export interface CreateOpts {
sources: Array<string>;
tags?: Array<string>;
platforms?: Array<string>;
annotations?: Array<string>;
dryRun?: boolean;
silent?: boolean;
skipExec?: boolean;

View File

@@ -12,9 +12,9 @@ __metadata:
languageName: node
linkType: hard
"@actions/artifact@npm:^6.2.0":
version: 6.2.0
resolution: "@actions/artifact@npm:6.2.0"
"@actions/artifact@npm:^6.2.1":
version: 6.2.1
resolution: "@actions/artifact@npm:6.2.1"
dependencies:
"@actions/core": "npm:^3.0.0"
"@actions/github": "npm:^9.0.0"
@@ -30,7 +30,7 @@ __metadata:
archiver: "npm:^7.0.1"
jwt-decode: "npm:^4.0.0"
unzip-stream: "npm:^0.3.1"
checksum: 10/fa931b1222c0e08bca85d3cb18c2cd5ae912cce3f09ab3acd4ec3486e864337d65177089a14aef124d9696b9dd5309b273a9251e230172c79c2444af2c43443e
checksum: 10/1fad9b079ee2ab07f964b93bf7b4fc594d115199219baed74ac3bf2a8675e0b7ea57252eccbcdaaaa8fc8375742d23585cbd054f3b2d029c091817e0f257ce93
languageName: node
linkType: hard
@@ -370,7 +370,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@docker/actions-toolkit@workspace:."
dependencies:
"@actions/artifact": "npm:^6.2.0"
"@actions/artifact": "npm:^6.2.1"
"@actions/cache": "npm:^6.0.0"
"@actions/core": "npm:^3.0.0"
"@actions/exec": "npm:^3.0.0"