Skip to content

Commit

Permalink
diff regex
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieMc0 committed Sep 13, 2023
1 parent 8d8128e commit 1dbd73f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/sast-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,10 @@ jobs:
labels: ["nosec"]
})
- name: Check for pattern
- name: Check for '#nosec' without specificed rule
run: |
DIFF=$(git diff ${{ github.event.pull_request.base.sha }})
echo "$DIFF" | grep -P '#nosec(?!(\sG\d{3}))(?![^\s\t])([\s\t]*|$)' && echo "Pattern found!" || echo "Pattern not found!"
echo "$DIFF" | grep -P '#nosec(?!(\sG\d{3}))(?![^\s\t])([\s\t]*|$)' && echo "nosec without specificed rule found!" && exit 1 || exit 0

0 comments on commit 1dbd73f

Please sign in to comment.