File tree Expand file tree Collapse file tree
actions/docker/sign-images Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -153,14 +153,19 @@ jobs:
153153 const taggedVersions = versions.filter(version => version.metadata.container.tags.length > 0);
154154 const untaggedVersions = versions.filter(version => version.metadata.container.tags.length === 0);
155155
156- // Expected tagged version is always 1 (the main tag)
157- const expectedTaggedVersions = 1;
156+ const platforms = JSON.parse(process.env.PLATFORMS);
157+ const isSinglePlatform = platforms.length === 1;
158+ const isSigned = process.env.SIGN === 'true';
159+
160+ // Expected tagged versions:
161+ // - Always 1 for the main tag
162+ // - Plus 1 for cosign legacy tag (sha256-...) when signed
163+ // Note: ghcr.io doesn't support OCI 1.1 referrers yet, so cosign falls back to legacy attachments
164+ const expectedTaggedVersions = isSigned ? 2 : 1;
158165
159166 // Expected untagged versions:
160167 // - For single platform: 0 (no multiarch manifest created)
161168 // - For multi platform: number of platforms (one per platform)
162- const platforms = JSON.parse(process.env.PLATFORMS);
163- const isSinglePlatform = platforms.length === 1;
164169 const expectedUntaggedVersions = isSinglePlatform ? 0 : platforms.length;
165170
166171 assert.equal(
Original file line number Diff line number Diff line change 9191 const annotationsArgs = tags.size > 0 ? `-a tag=${Array.from(tags).at(-1)}` : "";
9292 const imagesArgs = Array.from(imagesToSign).join(" ");
9393 // Use OCI 1.1 referrers mode to avoid creating legacy sha256-... tags
94+ // Note: If the registry doesn't support OCI 1.1 referrers (like ghcr.io currently),
95+ // cosign will fall back to legacy attachments and create a sha256-... tag
9496 const signImageCommand = `cosign sign ${annotationsArgs} --registry-referrers-mode=oci-1-1 --yes ${imagesArgs}`;
9597
9698 core.debug(`Signing images with command: "${signImageCommand}"`);
You can’t perform that action at this time.
0 commit comments