GitHub Fixer for Opengrep
Introduction
Goal
Initial Setup - Mobb API Token
Sample GitHub Action YAML
Example 1 - Full Scan + Mobb autofixer triggered manually
# Mobb/Opengrep Fixer on pull requests
# This workflow defines the needed steps to run Opengrep manually (workflow_dispatch) and send the results to Mobb Fixer.
#
# Secrets in use (add your missing ones):
# MOBB_API_TOKEN - your mobb user credentials (automatically set if you forked this repo via the Mobb app)
name: "Mobb/Opengrep Full Scan"
on:
workflow_dispatch:
jobs:
scan-and-fix:
name: Scan with Opengrep and fix with Mobb
runs-on: 'ubuntu-latest'
timeout-minutes: 360
permissions:
contents: read
pull-requests: write
statuses: write
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run Opengrep SAST scan
run: |
wget https://github.com/opengrep/opengrep/releases/download/v1.0.0-alpha.9/opengrep_manylinux_x86 -O opengrep
chmod +x opengrep
./opengrep ci --sarif --sarif-output opengrep_report.sarif --config auto --supress-errors
shell: bash -l {0}
- name: Upload SARIF file
if: always()
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: opengrep_report.sarif
category: my-opengrep-sast-tool
- name: Run Mobb on the findings and get fixes
if: always()
uses: mobb-dev/[email protected]
with:
report-file: "opengrep_report.sarif"
api-key: ${{ secrets.MOBB_API_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}Example 2 - Diff-aware scan + Mobb autofixer triggered via a Pull Request
Last updated