@@ -65,16 +65,12 @@ jobs:
6565 "hoverkraft-tech/ci-github-container/application-test",
6666 `"repository" output is not valid`
6767 );
68- assert.equal(
69- builtImage.digests.length,
70- 1,
71- `"digests" output is not valid`
72- );
7368 assert.match(
74- builtImage.digests[0] ,
75- /^ghcr\.io\/hoverkraft-tech\/ci-github-container\/application-test@ sha256:[a-f0-9]{64}$/,
76- `"digests " output is not valid`
69+ builtImage.digest ,
70+ /^sha256:[a-f0-9]{64}$/,
71+ `"digest " output is not valid`
7772 );
73+ assert.equal(builtImage.image, `ghcr.io/hoverkraft-tech/ci-github-container/application-test@${builtImage.digest}`, `"image" output is not valid`);
7874
7975 // Annotations
8076 assert.match(
@@ -123,47 +119,18 @@ jobs:
123119 assert.equal(builtImage.tags[0], prShaTag, `"tags" output is not valid`);
124120 assert.equal(builtImage.tags[1], prTag, `"tags" output is not valid`);
125121
126- assert.equal(
127- builtImage.images.length,
128- 2,
129- `"images" output is not valid`
130- );
131- assert.equal(
132- builtImage.images[0],
133- `ghcr.io/hoverkraft-tech/ci-github-container/application-test:${prShaTag}`,
134- `"images" output is not valid`
135- );
136- assert.equal(
137- builtImage.images[1],
138- `ghcr.io/hoverkraft-tech/ci-github-container/application-test:${prTag}`,
139- `"images" output is not valid`
140- );
141122 assert.equal(
142123 builtImage.annotations["org.opencontainers.image.version"],
143124 prTag,
144125 `"annotations.org.opencontainers.image.version" output is not valid`
145126 );
146-
147127 } else {
148128 const refTag = `${{ github.ref_name }}`;
149129
150130 assert.equal(builtImage.tags.length, 2, `"tags" output is not valid`);
151131 assert.equal(builtImage.tags[0], refTag, `"tags" output is not valid`);
152132 assert.equal(builtImage.tags[1], "latest", `"tags" output is not valid`);
153133
154- assert.equal(builtImage.images.length, 2, `"images" output is not valid`);
155- assert.equal(
156- builtImage.images[0],
157- `ghcr.io/hoverkraft-tech/ci-github-container/application-test:${refTag}`,
158- `"images" output is not valid`
159- );
160-
161- assert.equal(
162- builtImage.images[1],
163- `ghcr.io/hoverkraft-tech/ci-github-container/application-test:latest`,
164- `"images" output is not valid`
165- );
166-
167134 assert.equal(
168135 builtImage.annotations["org.opencontainers.image.version"],
169136 refTag,
@@ -177,20 +144,18 @@ jobs:
177144 username : ${{ github.repository_owner }}
178145 password : ${{ github.token }}
179146
180- - name : Assert - Check docker digests
147+ - name : Assert - Check docker image
181148 run : |
182- DIGESTS=$(echo '${{ steps.build-image.outputs.built-image }}' | jq -r '.digests[]')
183- for DIGEST in $DIGESTS; do
184- if ! docker pull "$DIGEST"; then
185- echo "Failed to pull $DIGEST"
186- exit 1
187- fi
188-
189- if ! docker manifest inspect "$DIGEST"; then
190- echo "Failed to inspect $DIGEST"
191- exit 1
192- fi
193- done
149+ IMAGE=$(echo '${{ steps.build-image.outputs.built-image }}' | jq -r '.image')
150+ if ! docker pull "$IMAGE"; then
151+ echo "Failed to pull $IMAGE"
152+ exit 1
153+ fi
154+
155+ if ! docker manifest inspect "$IMAGE"; then
156+ echo "Failed to inspect $IMAGE"
157+ exit 1
158+ fi
194159
195160 tests-with-given-tag :
196161 name : Test for "docker/build-image" action with given tag
@@ -249,19 +214,17 @@ jobs:
249214 username : ${{ github.repository_owner }}
250215 password : ${{ github.token }}
251216
252- - name : Assert - Check docker digests
217+ - name : Assert - Check docker image
253218 run : |
254- DIGESTS=$(echo '${{ steps.build-image.outputs.built-image }}' | jq -r '.digests[]')
255- for DIGEST in $DIGESTS; do
256- if ! docker pull "$DIGEST"; then
257- echo "Failed to pull $DIGEST"
258- exit 1
259- fi
260-
261- if ! docker manifest inspect "$DIGEST"; then
262- echo "Failed to inspect $DIGEST"
263- exit 1
264- fi
265- done
219+ IMAGE=$(echo '${{ steps.build-image.outputs.built-image }}' | jq -r '.image')
220+ if ! docker pull "$IMAGE"; then
221+ echo "Failed to pull $IMAGE"
222+ exit 1
223+ fi
224+
225+ if ! docker manifest inspect "$IMAGE"; then
226+ echo "Failed to inspect $IMAGE"
227+ exit 1
228+ fi
266229
267230# jscpd:ignore-end
0 commit comments