ci(secret): updated workflow 5 #35
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: Validate Secrets | |
on: | |
push: | |
branches: | |
- '**' # Run on all branches | |
jobs: | |
validate-secrets: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 'node' # Use the latest Node.js version | |
- name: Get Changed Files | |
id: changed-files | |
run: | | |
git diff --name-only HEAD~1 HEAD > changed_files.txt || git diff --name-only HEAD > changed_files.txt | |
cat changed_files.txt | |
- name: Validate Secrets in Changed Files | |
run: | | |
while read file; do | |
if [ -f "$file" ]; then | |
echo "Scanning $file" | |
node helper/workflow-secret-check "$file" | |
fi | |
done < changed_files.txt |