diff --git a/.github/workflows/debricked.yml b/.github/workflows/debricked.yml index 75ecf2f4..f2b0318d 100644 --- a/.github/workflows/debricked.yml +++ b/.github/workflows/debricked.yml @@ -7,9 +7,8 @@ on: pull_request: jobs: - vulnerabilities-scan: + scan: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - uses: actions/setup-go@v2 @@ -27,3 +26,12 @@ jobs: printf "$(go mod graph)\n\n$(go list -mod=readonly -e -m all)" > .debricked-go-dependencies.txt - run: | go run cmd/debricked/main.go scan -t ${{ secrets.DEBRICKED_TOKEN }} -e "**/testdata/**" + + docker-scan: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build Docker image + run: bash scripts/test_docker.sh cli + - name: Scan Docker image + run: go run cmd/debricked/main.go scan docker debricked/cli-scan:dev -t ${{ secrets.DEBRICKED_TOKEN }} \ No newline at end of file diff --git a/scripts/test_docker.sh b/scripts/test_docker.sh index d1ad38eb..2ba286cb 100644 --- a/scripts/test_docker.sh +++ b/scripts/test_docker.sh @@ -4,13 +4,13 @@ type="$1" case $type in "dev") - docker build -f build/docker/Dockerfile -t debricked/cli-dev:latest --target dev . + docker build -f build/docker/Dockerfile -t debricked/cli-dev:dev --target dev . ;; "cli") - docker build -f build/docker/Dockerfile -t debricked/cli:latest --target cli . + docker build -f build/docker/Dockerfile -t debricked/cli:dev --target cli . ;; "scan") - docker build -f build/docker/Dockerfile -t debricked/cli-scan:latest --target scan . + docker build -f build/docker/Dockerfile -t debricked/cli-scan:dev --target scan . ;; *) echo "${type} type is not supported!"