ci(secret): added google api key pattern test #42
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 'AIza[A-Za-z0-9_-]{35}' | |
git secrets --register-aws | |
- name: Scan for Secrets | |
run: | | |
git secrets --scan || (echo "Secrets detected in your push!"; exit 1) |