Skip to content

Commit

Permalink
Scan Docker images in Snyk Github action (close #90)
Browse files Browse the repository at this point in the history
  • Loading branch information
spenes committed Dec 1, 2023
1 parent b8da747 commit 186d646
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 20 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,19 @@ jobs:
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Publish docker image locally for Snyk action
run: make docker-build

- name: Run Snyk to monitor vulnerabilities in Docker image
uses: snyk/actions/docker@master
if: ${{ !contains(github.ref, 'rc') }}
with:
image: "snowplow/dataflow-runner:${{ github.ref_name }}"
args: "--app-vulns --org=data-processing-new"
command: monitor
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

- name: Create Release
uses: actions/create-release@v1
env:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,23 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Extract project version from file
id: version
run: |
echo ::set-output name=VERSION::"$(cat VERSION)"
- name: Run tests
run: |
export PATH="$PATH:/tmp/consul/"
make test
- name: Publish docker image locally for Snyk action
run: make docker-build

- name: Snyk Setup
uses: snyk/actions/setup@master

- name: Run Snyk to check for vulnerabilities in Docker image
run: snyk container test snowplow/dataflow-runner:${{steps.version.outputs.VERSION}} --severity-threshold=high
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
20 changes: 0 additions & 20 deletions .github/workflows/snyk.yml

This file was deleted.

0 comments on commit 186d646

Please sign in to comment.