Skip to content

Commit

Permalink
Unify OSV scanner action (google#711)
Browse files Browse the repository at this point in the history
Combine the 2 osv-scanner actions into one file.

This is an example of what will be shown in the starter-workflows
example, allowing us to have one starter-workflow that does both PR
scanning and scheduled scanning.

Ideally we can hide the skipped workflows, but that's not possible at
the moment: https://github.com/orgs/community/discussions/18001
  • Loading branch information
another-rex committed Dec 18, 2023
1 parent 86cf40f commit 297ac7e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 39 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/osv-scanner-pr.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,37 @@
name: OSV-Scanner Scheduled Scan

on:
pull_request:
branches: ["main"]
merge_group:
branches: ["main"]
schedule:
- cron: "12 12 * * 1"
push:
branches: ["main"]

permissions:
# Require writing security events to upload SARIF file to security tab
security-events: write
# Read commit contents
contents: read

jobs:
scan-scheduled:
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
uses: "./.github/workflows/osv-scanner-reusable.yml"
with:
# Just scan the root directory and docs, since everything else is fixtures
scan-args: |-
--skip-git
./
./docs/
permissions:
# Require writing security events to upload SARIF file to security tab
security-events: write
# Read commit contents
contents: read
scan-pr:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
uses: "./.github/workflows/osv-scanner-reusable-pr.yml"
with:
# Just scan the root directory and docs, since everything else is fixtures
scan-args: |-
--skip-git
./
./docs/

0 comments on commit 297ac7e

Please sign in to comment.