Skip to content

Commit

Permalink
Update semgrep.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MaulikxLakhani authored Aug 1, 2024
1 parent 803b369 commit c8c631c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
- master
paths:
- '**/*.py' # Modify this to match your code files if different from Python
- '**/*.py' # Include Python files if your repo has Python code
- '.github/workflows/semgrep.yml'
pull_request:
branches:
Expand All @@ -17,7 +17,7 @@ on:
jobs:
semgrep:
name: semgrep/ci
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
steps:
Expand All @@ -30,5 +30,9 @@ jobs:
- name: Install Semgrep
run: pip install semgrep

- name: Run Semgrep diff scan
run: semgrep --config auto --diff
- name: Get base branch ref
id: vars
run: echo "::set-output name=BASE_REF::$(echo ${{ github.event.pull_request.base.sha }} || echo origin/main)"

- name: Run Semgrep
run: semgrep --config auto --diff ${{ steps.vars.outputs.BASE_REF }} $(git rev-parse HEAD)

0 comments on commit c8c631c

Please sign in to comment.