Skip to content

Commit

Permalink
Add pre-commit hook for validating release notes
Browse files Browse the repository at this point in the history
- This is a pre-commit hook using `pre-commit` framework to validate release notes YAML files.
- The hook checks for correct structure, formatting and required fields in the `release-notes` directory.
- This ensures consistency in release notes before committing changes.
- Added release notes validation to the `make syntax-check` target

Ref: coreos#934 (comment)
  • Loading branch information
aaradhak authored and jlebon committed Nov 27, 2024
1 parent 8efce78 commit 9d127d4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 19 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/validate-release-notes.yml

This file was deleted.

9 changes: 9 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -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$)
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9d127d4

Please sign in to comment.