ci: right-size OpenGrep PR scan

* ci: right-size opengrep pr scan

* ci: avoid opengrep rulepack self-scan

* ci: opt opengrep workflows into node24 actions

* ci: update opengrep workflow action majors
This commit is contained in:
Vincent Koc
2026-04-30 01:52:12 -07:00
committed by GitHub
parent d50ad19e4b
commit 005eeca06f
3 changed files with 26 additions and 6 deletions

View File

@@ -9,11 +9,25 @@ name: OpenGrep — PR Diff
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- ".github/workflows/opengrep-precise.yml"
- ".github/workflows/opengrep-precise-full.yml"
- ".semgrepignore"
- "apps/**"
- "extensions/**"
- "packages/**"
- "scripts/**"
- "security/opengrep/**"
- "src/**"
concurrency:
group: opengrep-pr-diff-${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
permissions:
contents: read
security-events: write
@@ -21,11 +35,12 @@ permissions:
jobs:
scan:
name: Scan changed paths (precise)
runs-on: blacksmith-16vcpu-ubuntu-2404
if: ${{ !github.event.pull_request.draft }}
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
persist-credentials: false
# `scripts/run-opengrep.sh --changed` diffs base...HEAD.
@@ -59,7 +74,7 @@ jobs:
scripts/run-opengrep.sh --changed --sarif --error
- name: Upload SARIF to GitHub Code Scanning
uses: github/codeql-action/upload-sarif@v3
uses: github/codeql-action/upload-sarif@v4
# Only upload if the scan actually produced a SARIF file.
if: always() && hashFiles('.opengrep-out/precise.sarif') != ''
with: