@@ -255,7 +255,7 @@ jobs:
255255 - name : Run Trivy vulnerability scanner sarif
256256 uses : aquasecurity/trivy-action@master
257257 with :
258- image-ref : ${{ steps.meta.outputs.tags }}
258+ image-ref : ${{ fromJSON( steps.meta.outputs.json). tags[0] }}
259259 scan-type : image
260260 exit-code : 0
261261 format : " sarif"
@@ -269,20 +269,10 @@ jobs:
269269 with :
270270 sarif_file : " trivy-results.sarif"
271271
272- - name : Extract metadata for Docker
273- id : meta2
274- uses : docker/metadata-action@v5
275- with :
276- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} # TODO(berry): fix on git labels multiple tags
277- flavor : |
278- latest=false
279- env :
280- DOCKER_METADATA_ANNOTATIONS_LEVELS : manifest,index
281-
282272 - name : Run Trivy SBOM
283273 uses : aquasecurity/trivy-action@master
284274 with :
285- image-ref : ${{ steps.meta2 .outputs.tags }}
275+ image-ref : ${{ fromJSON( steps.meta .outputs.json). tags[0] }}
286276 scan-type : image
287277 exit-code : 0
288278 format : " cyclonedx"
@@ -295,7 +285,7 @@ jobs:
295285 - name : Run Trivy license scanner
296286 uses : aquasecurity/trivy-action@master
297287 with :
298- image-ref : ${{ steps.meta2 .outputs.tags }}
288+ image-ref : ${{ fromJSON( steps.meta .outputs.json). tags[0] }}
299289 scan-type : image
300290 scanners : " license"
301291 exit-code : 0
@@ -337,7 +327,7 @@ jobs:
337327
338328 - name : Trigger deployment
339329 run : |
340- gh workflow run deploy.yml -f image_tag=${{ steps.meta.outputs.tags }} -f environment=production
330+ gh workflow run deploy.yml -f image_tag=${{ fromJSON( steps.meta.outputs.json). tags[0] }} -f environment=production
341331 env :
342332 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
343333
0 commit comments