Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: shell commands for composite action #126

Merged
merged 1 commit into from
Nov 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/actions/docker-scan/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,22 @@ runs:
- name: Install Trivy
run: |
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin v0.34.0
shell: bash

- name: run trivy docker
run: |
trivy image \
--format github \
--vuln-type os,library \
--security-checks vuln \
--output dependency-results.sbom.json \
${{ inputs.docker_image }}
run: |
trivy image \
--format github \
--vuln-type os,library \
--security-checks vuln \
--output dependency-results.sbom.json \
${{ inputs.docker_image }}
shell: bash

- name: replace apk with alpine
run: |
sed -i 's/pkg:apk/pkg:alpine/g' dependency-results.sbom.json
shell: bash

- name: upload sbom to github
run: |
Expand All @@ -34,6 +37,7 @@ runs:
-H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' \
'https://api.github.com/repos/'$GITHUB_REPOSITORY'/dependency-graph/snapshots' \
-d @dependency-results.sbom.json
shell: bash

- name: run docker vulnerability scanner
uses: aquasecurity/trivy-action@9ab158e8597f3b310480b9a69402b419bc03dbd5
Expand Down