From a5b7b97e8683751b19e8e59a7f989f29dfbc1701 Mon Sep 17 00:00:00 2001 From: Alex Parsons Date: Mon, 9 Dec 2024 15:23:25 +0000 Subject: [PATCH] Add validate action --- .github/workflows/validate.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/validate.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 00000000..d80f33f7 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,34 @@ +name: Validate + +on: [push] + +jobs: + test: + name: Validate + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - uses: actions/setup-python@v5 + with: + python-version: '3.9' + + - name: setup ruff + run: pip install mysoc-validator==0.9.3 + + - name: Check and format + run: | + python -m mysoc_validator popolo validate members/people.json --format + + - name: Check format hasn't changed anything + run: | + if [[ -n $(git status --porcelain) ]]; then + echo "Uncommitted changes detected:" + git status --porcelain + exit 1 + else + echo "No file changes detected." + fi \ No newline at end of file