diff --git a/.github/workflows/validate-release-notes.yml b/.github/workflows/validate-release-notes.yml deleted file mode 100644 index 842ff74..0000000 --- a/.github/workflows/validate-release-notes.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Validate Release Notes - -on: - pull_request: - branches: [main] - paths: ["release-notes/*.yml"] - -jobs: - validate: - name: Validate Release Notes - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - name: Validate Release Notes - run: python ci/check-release-notes.py release-notes/next.yml release-notes/stable.yml release-notes/testing.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..a524304 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,9 @@ +repos: +- repo: local + hooks: + - id: syntax-check + name: Syntax Check + entry: make syntax-check + language: system + types: [yaml, json] + files: ^(release-notes/.*\.yml$|streams/.*\.json$|updates/.*\.json$) diff --git a/Makefile b/Makefile index 90b2d76..8424813 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,8 @@ -.PHONY: syntax-check +.PHONY: syntax-check print-rollouts + syntax-check: @find streams updates -iname '*.json' | sort | xargs -n 1 python3 -c 'import json, sys; json.load(open(sys.argv[1]))' + @find release-notes -iname '*.yml' | sort | xargs -n1 python3 ci/check-release-notes.py -.PHONY: print-rollouts print-rollouts: @find updates -iname '*.json' -printf '%f\n' | cut -f1 -d. | sort | xargs ./rollout.py print