Skip to content

Commit fc8e797

Browse files
authored
feat(ci): Add Opengrep as a reusable workflow
1 parent 9bf0e34 commit fc8e797

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

.github/workflows/sec-opengrep.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
name: Security - Opengrep
6+
7+
on:
8+
workflow_call:
9+
10+
permissions:
11+
contents: read
12+
security-events: write
13+
14+
env:
15+
# Release version of Opengrep
16+
# https://github.com/opengrep/opengrep/releases
17+
RELEASE_VERSION: v1.0.0-alpha.13
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: "Checkout code"
24+
uses: actions/checkout@v4
25+
26+
- name: "Download / Install Opengrep"
27+
run: |
28+
set -e
29+
30+
echo "[+] Downloading Opengrep"
31+
curl -sSfL \
32+
-o "/usr/local/bin/opengrep" \
33+
"https://github.com/opengrep/opengrep/releases/download/${RELEASE_VERSION}/opengrep_manylinux_x86"
34+
chmod +x /usr/local/bin/opengrep
35+
echo "[+] Finished installing opengrep"
36+
37+
- name: "Run Opengrep"
38+
run: opengrep scan --metrics=off --sarif-output ./results.sarif .
39+
40+
- name: "Upload SARIF file"
41+
uses: github/codeql-action/upload-sarif@v3
42+
with:
43+
sarif_file: results.sarif
44+
if: always()

0 commit comments

Comments
 (0)