diff --git a/.github/workflows/checkov.yaml b/.github/workflows/checkov.yaml new file mode 100644 index 0000000..b6a9223 --- /dev/null +++ b/.github/workflows/checkov.yaml @@ -0,0 +1,30 @@ +name: checkov + +on: + # Triggers the workflow on pull request events but only for the "main" branch + pull_request: + branches: [ "main", "master" ] + workflow_dispatch: + +permissions: + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + +jobs: + scan: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Checkov GitHub Action + uses: bridgecrewio/checkov-action@v12 + with: + output_format: cli,sarif + output_file_path: console,results.sarif + + - name: Upload SARIF file + uses: github/codeql-action/upload-sarif@v3 + if: success() || failure() + with: + sarif_file: results.sarif