Skip to content

Commit

Permalink
Update sast-linters.yml
Browse files Browse the repository at this point in the history
- Exclude .github/workflows/sast-linters.yml from gosec nosec use scanning
  • Loading branch information
CryptoFewka authored Jun 24, 2024
1 parent 3a96ba6 commit 8d22c40
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/sast-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ jobs:
echo "Changed files: ${{ steps.changed-files.outputs.all_changed_files }}"
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
# Skip this workflow file
if [ "$file" == ".github/workflows/sast-linters.yml" ]; then
echo "Skipping nosec check for $file"
continue
fi
if git diff ${{ github.event.pull_request.base.sha }} $file | grep -q nosec; then
echo "nosec detected in $file"
nosec_list+=("$file,")
Expand All @@ -118,6 +124,7 @@ jobs:
echo "nosec_files=$nosec_list_string" >> $GITHUB_ENV
echo "nosec_detected=$nosec_detected" >> $GITHUB_ENV
- name: Report nosec uses
uses: mshick/add-pr-comment@v2
if: env.nosec_detected == 1
Expand Down Expand Up @@ -151,4 +158,4 @@ jobs:
echo "$DIFF" | grep -P '#nosec(?!(\sG\d{3}))(?![^\s\t])([\s\t]*|$)' && echo "nosec without specified rule found!" && exit 1 || exit 0

0 comments on commit 8d22c40

Please sign in to comment.