@@ -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,21 +119,6 @@ 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,
@@ -151,19 +132,6 @@ jobs:
151132 assert.equal(builtImage.tags[0], refTag, `"tags" output is not valid`);
152133 assert.equal(builtImage.tags[1], "latest", `"tags" output is not valid`);
153134
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-
167135 assert.equal(
168136 builtImage.annotations["org.opencontainers.image.version"],
169137 refTag,
@@ -177,20 +145,18 @@ jobs:
177145 username : ${{ github.repository_owner }}
178146 password : ${{ github.token }}
179147
180- - name : Assert - Check docker digests
148+ - name : Assert - Check docker digest
181149 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
150+ DIGEST=$(echo '${{ steps.build-image.outputs.built-image }}' | jq -r '.digest')
151+ if ! docker pull "$DIGEST"; then
152+ echo "Failed to pull $DIGEST"
153+ exit 1
154+ fi
155+
156+ if ! docker manifest inspect "$DIGEST"; then
157+ echo "Failed to inspect $DIGEST"
158+ exit 1
159+ fi
194160
195161 tests-with-given-tag :
196162 name : Test for "docker/build-image" action with given tag
@@ -249,19 +215,17 @@ jobs:
249215 username : ${{ github.repository_owner }}
250216 password : ${{ github.token }}
251217
252- - name : Assert - Check docker digests
218+ - name : Assert - Check docker image
253219 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
220+ IMAGE=$(echo '${{ steps.build-image.outputs.built-image }}' | jq -r '.image')
221+ if ! docker pull "$IMAGE"; then
222+ echo "Failed to pull $IMAGE"
223+ exit 1
224+ fi
225+
226+ if ! docker manifest inspect "$IMAGE"; then
227+ echo "Failed to inspect $IMAGE"
228+ exit 1
229+ fi
266230
267231# jscpd:ignore-end
0 commit comments