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 c8c631c commit 1b9782d
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ on:
- main
- master
paths:
- '**/*.py' # Include Python files if your repo has Python code
- '**/*.py' # Include Python files if your repo has Python code
- '**/*.js' # Include JavaScript files if applicable
- '**/*.html' # Include HTML files if applicable
- '**/*.css' # Include CSS files if applicable
- '.github/workflows/semgrep.yml'
pull_request:
branches:
Expand All @@ -24,15 +27,8 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Install Semgrep Agent
run: pip install semgrep-agent

- name: Install Semgrep
run: pip install semgrep

- 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)
- name: Run Semgrep Agent
run: semgrep-agent --config auto --baseline-ref $(git rev-parse origin/main)

0 comments on commit 1b9782d

Please sign in to comment.