Skip to content

Commit

Permalink
More image scanning fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wall <pete.wall@grafana.com>
  • Loading branch information
petewall committed Oct 30, 2024
1 parent 634f864 commit 9041cbe
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/security-scans.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ jobs:
id: list_images
run: |

Check failure on line 29 in .github/workflows/security-scans.yml

View workflow job for this annotation

GitHub Actions / runner / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2129:style:3:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck] Raw Output: .github/workflows/security-scans.yml:29:9: shellcheck reported issue in this script: SC2129:style:3:1: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]
file=charts/k8s-monitoring/docs/examples/features/all-features/output.yaml
yq -r -o json '. | select(.kind=="DaemonSet") | .spec.template.spec.containers[].image' "${file}" > images.txt
yq -r -o json '. | select(.kind=="Deployment") | .spec.template.spec.containers[].image' "${file}" > images.txt
yq -r -o json '. | select(.kind=="Job") | .spec.template.spec.containers[].image' "${file}" > images.txt
yq -r -o json '. | select(.kind=="Pod") | .spec.containers[].image' "${file}" > images.txt
yq -r -o json '. | select(.kind=="StatefulSet") | .spec.template.spec.containers[].image' "${file}" > images.txt
touch images.txt
yq -r -o json '. | select(.kind=="DaemonSet") | .spec.template.spec.containers[].image' "${file}" >> images.txt
yq -r -o json '. | select(.kind=="Deployment") | .spec.template.spec.containers[].image' "${file}" >> images.txt
yq -r -o json '. | select(.kind=="Job") | .spec.template.spec.containers[].image' "${file}" >> images.txt
yq -r -o json '. | select(.kind=="Pod") | .spec.containers[].image' "${file}" >> images.txt
yq -r -o json '. | select(.kind=="StatefulSet") | .spec.template.spec.containers[].image' "${file}" >> images.txt
echo "images=$(sort --unique < images.txt | jq --raw-input --slurp --compact-output 'split("\n") | map(select(. != ""))')" >> "${GITHUB_OUTPUT}"
scan-container-images:
Expand All @@ -45,7 +46,7 @@ jobs:
fail-fast: false
steps:
- name: Run Trivy
uses: aquasecurity/trivy-action@v0.28
uses: aquasecurity/trivy-action@0.28.0
with:
image-ref: ${{ matrix.image }}
format: sarif
Expand Down

0 comments on commit 9041cbe

Please sign in to comment.