Skip to content

chore: use reusable image scan #119

chore: use reusable image scan

chore: use reusable image scan #119

Workflow file for this run

# NOTE refs
# - https://github.com/aquasecurity/trivy-action#using-trivy-to-scan-your-private-registry
name: scan
on:
push:
branches:
- main
schedule:
- cron: "0 0 * * MON"
workflow_dispatch: {}
permissions:
contents: read
security-events: write
concurrency:
group: ${{ github.run_id }}
cancel-in-progress: false
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set.outputs.matrix }}
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- id: set
run: |
echo "matrix=$(jq -r -c '.sync as $sync | .build as $build | {"include":[{"destination": $sync[].destination}, {"destination": $build[].destination}]}' <<< "$(yq e . -o json config.yaml)")" >> $GITHUB_OUTPUT
- name: check output
run: |
jq . <<< '${{ steps.set.outputs.matrix }}'
scan:
if: ${{ fromJSON(needs.prepare.outputs.matrix) != null }}
needs: prepare
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}
uses: GeoNet/Actions/.github/workflows/reusable-container-image-scan.yml@main
with:
imageRefs: ${{ fromJSON(toJSON(matrix)).destination }}