diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b0a6910 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +name: CI + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + check: + runs-on: ubuntu-latest + timeout-minutes: 2 + steps: + - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 + with: + persist-credentials: false + - name: Validate JSON manifests + run: | + python3 - <<'PY' + import json + import subprocess + from pathlib import Path + + names = subprocess.check_output(["git", "ls-files", "-z", "--", "*.json"]) + for name in filter(None, names.split(b"\0")): + path = Path(name.decode("utf-8")) + if path.is_symlink() or not path.is_file(): + raise ValueError(f"manifest must be a regular file: {path}") + json.loads(path.read_text(encoding="utf-8")) + print(f"valid: {path}") + PY