browsertrix/.github/workflows/password-check.yaml
Anish Lakhwara b5a9c42df1
feat: add pre-commit to check we don't have real passwords in yml files (#990)
* feat: use existing pre-commit framework

* feat(ci): add github action for password_check

* feat: add some simple tests to password_check.py

* fix: set `backend_password_secret` in default values.yaml to an allowed password
2023-07-26 13:29:37 -07:00

41 lines
878 B
YAML

name: Password Check
on:
push:
paths:
- '*.yaml'
- '*.yml'
pull_request:
paths:
- '*.yaml'
- '*.yml'
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
cd backend/
python -m pip install --upgrade pip
pip install pyyaml
- name: Password Check
run: |
CHANGED_FILES=$(git diff --name-only HEAD^..HEAD)
echo $CHANGED_FILES
YML_FILES=$(echo "$CHANGED_FILES" | { grep ".yml$\|.yaml$" || true; })
if [[ -n "$YML_FILES" ]]; then
python3 scripts/check_passwords.py $YML_FILES
fi