[Github Action] Check all secrets are replaced by bin/generate-secrets #1
Workflow file for this run
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: Check missed field for secret generation | ||
on: | ||
pull_request: | ||
branches: | ||
- '**' # This will trigger the workflow for any PR branch | ||
jobs: | ||
check_secrets: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Run bin/generate-secrets | ||
run: bin/generate-secrets | ||
- name: Check all "secret" fields are replaced | ||
run: | | ||
if grep -q "secret" etc/secrets.yaml; then | ||
echo "Not all 'secret' fields were replaced by bin/generate-secrets script. \ | ||
Please make sure to cover the following fields with a 'insert_secret' entry: \n | ||
Check failure on line 23 in .github/workflows/secrets.yaml GitHub Actions / Check missed field for secret generationInvalid workflow file
|
||
$(yq e '.. | select(. == "secret") | {(path | join(".")): .}' etc/secrets.yaml)" | ||
exit 1 | ||
else | ||
echo "All secret fields are replaced" | ||
exit 0 | ||
fi |