Skip to content

Specify files to ignore #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MyNameIsOka opened this issue Aug 9, 2024 · 2 comments
Open

Specify files to ignore #5

MyNameIsOka opened this issue Aug 9, 2024 · 2 comments

Comments

@MyNameIsOka
Copy link

Hi community,

is there a way to specify files which should be ignored and not checked?

I found resources speaking about CodeGuru Reviewer but not CodeGuru Security.

@vineetdpnd
Copy link

We need the same as well. Were you able to figure it out @MyNameIsOka ?

@ThomasBalfour
Copy link

ThomasBalfour commented Apr 14, 2025

Workaround for this:

Let’s say you want to exclude the following directories or files:

  • www/lib
  • src/generated
  • tests/helpers/mockData.ts
  • docs/temp

You would set up an rsync step to make a new directory, in this case "filtered-src" then rsync the source to the new folder excluding the ones you don't want:

- name: Prepare source excluding specific files and folders
  run: |
    mkdir filtered-src
    rsync -av \
      --exclude='www/lib' \
      --exclude='src/generated' \
      --exclude='tests/helpers/mockData.ts' \
      --exclude='docs/temp' \
      ./ filtered-src/

Notes:
Each --exclude matches a relative path from the root of the repo.
Paths with forward slashes (/) are recommended for cross-platform consistency.
You can also use wildcards like --exclude='**/node_modules' to match patterns recursively.

You then update your source-path in the Codeguru analysis step to point to your rsynced folder:

      - name: CodeGuru Security
        uses: aws-actions/codeguru-security@v1
        with:
          source_path: filtered-src
          aws_region: eu-west-2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants