reviewdog / action-detect-secrets

GitHub Action: Run detect-secrets with reviewdog
MIT License
22 stars 11 forks source link

Way to ignore a directory #16

Closed emmahsax closed 3 years ago

emmahsax commented 3 years ago

Is there a way to ignore a directory? We can set workdir, which tells us where to run the action. But it'd be nice if there was a way to ignore a list of directories.

levonet commented 3 years ago

Yes, you can pass arguments through detect_secrets_flags. detect-secrets can ignore different cases, for example, you can ignore directories using regex:

    - uses: reviewdog/action-detect-secrets@v0.4.1
      with:
        github_token: ${{ secrets.github_token }}
        reporter: ${{ github.event_name == 'pull_request' && 'github-pr-review' || 'github-check' }}
        fail_on_error: 'true'
        detect_secrets_flags: --all-files --force-use-all-plugins --exclude-files (.git|.github/actions)/
emmahsax commented 3 years ago

Thank you! This solution does seem to work.