Skip to content

Commit

Permalink
issue #172: start, missing vault fetch secret step
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCardin committed Dec 4, 2024
1 parent ae4046a commit b968d2d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
Empty file.
48 changes: 48 additions & 0 deletions .github/workflows/workflow-detect-secret-leaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Detect secrets leaks

Check warning on line 1 in .github/workflows/workflow-detect-secret-leaks.yml

View workflow job for this annotation

GitHub Actions / yaml-lint-check

1:1 [document-start] missing document start "---"

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

0 comments on commit b968d2d

Please sign in to comment.