Skip to content

Updated README.md

Updated README.md #8

name: Trivy vulnerability scanner
on:
push:
branches:
- main
pull_request:
permissions:
contents: write
jobs:
build:
name: Build
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build an image from Dockerfile
run: |
docker build -t docker.io/siddhantprateek/qdapi:${{ github.sha }} .
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: 'docker.io/siddhantprateek/qdapi:${{ github.sha }}'
format: 'sarif'
output: 'trivy-results.sarif'
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: 'trivy-results.sarif'
- name: Run Trivy vulnerability scanner - s2
uses: aquasecurity/trivy-action@master
with:
image-ref: 'docker.io/siddhantprateek/qdapi:${{ github.sha }}'
format: 'table'
output: 'trivy-results.txt'
exit-code: '0'
ignore-unfixed: true
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH,MEDIUM'
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: update vulnerability list
title: Update vulnerability list
body: Update the vulnerability list
branch: update-vulnerabilities