Skip to content

Commit

Permalink
👷 update semgrep workflow to use paths-filter for improved file chang…
Browse files Browse the repository at this point in the history
…e detection
  • Loading branch information
AjayKMehta committed Jan 17, 2025
1 parent 8063bdc commit c40ab31
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@ on:
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
paths-ignore:
- "**/*.md"
- "**/*.txt"
- "**/.editorconfig"
- "**/*.runsettings"
- "**/typos.toml"
- ".github/**"
- "!.github/workflows/semgrep.yml"

push:
branches:
- main
Expand Down Expand Up @@ -40,5 +33,24 @@ jobs:
container:
image: returntocorp/semgrep
steps:
- uses: actions/[email protected]
- run: semgrep ci
- name: 'Checkout Repository'
uses: actions/[email protected]
- name: "Check for changed files"
uses: dorny/paths-filter@v3
id: filter
with:
predicate-quantifier: 'every'
filters: |
code:
- "!**/*.md"
- "!**/*.txt"
- "!**/.editorconfig"
- "!**/*.runsettings"
- "!**/typos.toml"
- "!.github/**"
workflow:
- ".github/workflows/semgrep.yml"
- name: 'Run Semgrep'
if: steps.filter.outputs.code == 'true' || steps.filter.outputs.workflow == 'true'
run: semgrep ci

0 comments on commit c40ab31

Please sign in to comment.