diff --git a/.github/workflows/scan.yaml b/.github/workflows/scan.yaml new file mode 100644 index 0000000..fc9f6ed --- /dev/null +++ b/.github/workflows/scan.yaml @@ -0,0 +1,21 @@ +name: build +on: + pull_request: + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Build an image from Dockerfile + run: | + docker build -t ${{ github.sha }} . + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + image-ref: '${{ github.sha }}' + format: 'table' + exit-code: '1' + severity: 'CRITICAL,HIGH' \ No newline at end of file