diff --git a/.github/workflows/osv-scanner.yml b/.github/workflows/osv-scanner.yml new file mode 100644 index 0000000..d63a267 --- /dev/null +++ b/.github/workflows/osv-scanner.yml @@ -0,0 +1,38 @@ +name: OSV-Scanner PR Scan + +# Change "main" to your default branch if you use a different name, i.e. "master" +on: + pull_request: + branches: [main] + merge_group: + branches: [main] + push: + branches: [main] + +permissions: + # Required to upload SARIF file to CodeQL. See: https://github.com/github/codeql-action/issues/2117 + actions: read + # Require writing security events to upload SARIF file to security tab + security-events: write + # Only need to read contents + contents: read + +jobs: + scan-scheduled: + if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} + uses: google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@126676819209c3a606f31bc46ad974fba4f2012c # v1.9.2 + with: + # Example of specifying custom arguments + scan-args: |- + -r + --skip-git + ./ + scan-pr: + if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }} + uses: google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@126676819209c3a606f31bc46ad974fba4f2012c # v1.9.2 + with: + # Example of specifying custom arguments + scan-args: |- + -r + --skip-git + ./