Skip to content

The-Infra-Company/github-action-trivy-upload

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

github-action-trivy-upload Latest Release

A GitHub Action to run Trivy and post the results to the GitHub Security tab.

trivy-findings

Usage

name: Trivy

on:
  pull_request:
    branches: [ 'main' ]
    types: [ opened, synchronize, reopened, closed, labeled, unlabeled ]

jobs:
  terraform:
    runs-on: ubuntu-latest
    steps:
      - name: Clone repo
        uses: actions/checkout@v4

      - name: Setup Terraform
        uses: hashicorp/setup-terraform@v3

      - name: Terraform Init
        run: terraform init
        working-directory: "terraform/modules/vpc"

      - name: Run Trivy
        uses: The-Infra-Company/github-action-trivy-upload@0.2.0
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          working_directory: "terraform/modules/vpc"

Inputs

name description required default
github_token

GITHUB_TOKEN

true ${{ github.token }}
working_directory

Directory to run the action on, from the repo root. Default is . (root of the repository)

false .
trivy_command

Trivy command [aws,config,filesystem,image,kubernetes,rootfs,sbom,vm]

true config
trivy_version

The version of trivy to install. Default is latest.

false latest
trivy_flags

List of arguments to send to trivy For the output to be parsable by reviewdog --format=checkstyle is enforced Default is blank.

false ""

Outputs

name description
trivy-return-code

trivy command return code

About

A GitHub Action to run Trivy and post the results to the GitHub Security tab.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Languages