Skip to content

[Github Action] Check all secrets are replaced by bin/generate-secrets #1

[Github Action] Check all secrets are replaced by bin/generate-secrets

[Github Action] Check all secrets are replaced by bin/generate-secrets #1

Workflow file for this run

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

View workflow run for this annotation

GitHub Actions / Check missed field for secret generation

Invalid workflow file

The workflow is not valid. .github/workflows/secrets.yaml (Line: 23, Col: 1): Unexpected value 'Please make sure to cover the following fields with a 'insert_secret' entry' .github/workflows/secrets.yaml (Line: 24, Col: 1): Unexpected value '$(yq e '.. | select(. == "secret") | {(path | join("."))'
$(yq e '.. | select(. == "secret") | {(path | join(".")): .}' etc/secrets.yaml)"
exit 1
else
echo "All secret fields are replaced"
exit 0
fi