Skip to content

Create trivy.yml

Create trivy.yml #2

Workflow file for this run

name: Build and Scan Docker Images
on:
push:
branches:
- develop
pull_request:
branches:
- develop
jobs:
build-dockers:
strategy:
matrix:
include:
- SERVICE_LOCATION: 'admin/admin-service'
SERVICE_NAME: 'admin-service'
BUILD_ARTIFACT: 'admin'
- SERVICE_LOCATION: 'admin/hotlist-service'
SERVICE_NAME: 'hotlist-service'
BUILD_ARTIFACT: 'admin'
- SERVICE_LOCATION: 'admin/kernel-masterdata-service'
SERVICE_NAME: 'kernel-masterdata-service'
BUILD_ARTIFACT: 'admin'
- SERVICE_LOCATION: 'admin/kernel-syncdata-service'
SERVICE_NAME: 'kernel-syncdata-service'
BUILD_ARTIFACT: 'admin'
fail-fast: false
name: ${{ matrix.SERVICE_NAME }}
uses: mosip/kattu/.github/workflows/docker-build.yml@master

Check failure on line 30 in .github/workflows/trivy.yml

View workflow run for this annotation

GitHub Actions / Build and Scan Docker Images

Invalid workflow file

The workflow is not valid. .github/workflows/trivy.yml (Line: 30, Col: 11): Secret RELEASE_DOCKER_HUB is required, but not provided while calling. .github/workflows/trivy.yml (Line: 30, Col: 11): Secret ACTOR_DOCKER_HUB is required, but not provided while calling.
with:
SERVICE_LOCATION: ${{ matrix.SERVICE_LOCATION }}
SERVICE_NAME: ${{ matrix.SERVICE_NAME }}
BUILD_ARTIFACT: ${{ matrix.BUILD_ARTIFACT }}
secrets:
DEV_NAMESPACE_DOCKER_HUB: ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }}
scan-dockers:
needs: build-dockers
runs-on: ubuntu-latest
strategy:
matrix:
include:
- SERVICE_NAME: 'admin-service'
- SERVICE_NAME: 'hotlist-service'
- SERVICE_NAME: 'kernel-masterdata-service'
- SERVICE_NAME: 'kernel-syncdata-service'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Trivy
run: |
sudo apt-get update
sudo apt-get install -y wget apt-transport-https gnupg lsb-release
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update
sudo apt-get install -y trivy
- name: Scan Docker image
run: trivy image ${{ secrets.DEV_NAMESPACE_DOCKER_HUB }}/${{ matrix.SERVICE_NAME }}:latest