-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue #172: start, missing vault fetch secret step
- Loading branch information
1 parent
ae4046a
commit b968d2d
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Detect secrets leaks | ||
|
||
on: | ||
workflow_call: | ||
push: | ||
branches: | ||
- "**" | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
detect-secret-leaks: | ||
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 | ||
git secrets --version | ||
- name: Configure git-secrets | ||
run: | | ||
git secrets --install | ||
- name: Add API keys to git-secrets | ||
env: | ||
API_KEYS: ${{ secrets.AI_CFIA_API_KEYS }} | ||
run: | | ||
echo "$API_KEYS" > api_keys.txt | ||
while IFS= read -r api_key; do | ||
git secrets --add --literal "$api_key" | ||
done < api_keys.txt | ||
rm -f api_keys.txt | ||
- name: Scan repository for secrets | ||
run: | | ||
git secrets --scan -r | ||
- name: Remove git-secrets patterns | ||
run: | | ||
git config --remove-section git-secrets || true |