diff --git a/.github/workflows/sast-linters.yml b/.github/workflows/sast-linters.yml index 2372ff5264..913448bb58 100644 --- a/.github/workflows/sast-linters.yml +++ b/.github/workflows/sast-linters.yml @@ -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,") @@ -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 @@ -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 - \ No newline at end of file +