ci(secret): added files pattern #54
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: git-secrets-check | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
jobs: | |
secrets-scan: | |
name: Scan for Secrets | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Install git-secrets | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y git | |
git clone https://github.com/awslabs/git-secrets.git | |
cd git-secrets && sudo make install | |
- name: Configure git-secrets | |
run: | | |
git secrets --install | |
git secrets --add-provider -- cat helper/secret-patterns.txt | |
git secrets --register-aws | |
- name: Scan for Secrets | |
run: | | |
git diff --cached --name-only | grep -E '\.(tsx|ts)$' | xargs git secrets --scan || (echo "Secrets detected in your push!"; exit 1) |