From edb517f7d0f30a18ac6f2cd60051a0118848de10 Mon Sep 17 00:00:00 2001 From: Narvis Bot Date: Mon, 2 Mar 2026 12:15:54 -0800 Subject: [PATCH] ci: add proto generation freshness check Add a new CI workflow that verifies proto-generated code is up to date. The workflow installs buf and the sebuf protoc plugins, runs `make generate`, and fails if any files in src/generated/ or docs/api/ differ from what is committed. This prevents proto definitions from drifting out of sync with the generated TypeScript and OpenAPI output. Closes #200 Co-Authored-By: Claude Opus 4.6 --- .github/workflows/proto-check.yml | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/proto-check.yml diff --git a/.github/workflows/proto-check.yml b/.github/workflows/proto-check.yml new file mode 100644 index 000000000..2792be66c --- /dev/null +++ b/.github/workflows/proto-check.yml @@ -0,0 +1,42 @@ +name: Proto Generation Check + +on: + pull_request: + paths: + - 'proto/**' + - 'src/generated/**' + - 'docs/api/**' + - 'Makefile' + +jobs: + proto-freshness: + if: github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: '1.23' + cache: false + + - name: Install buf and protoc plugins + run: make install-buf install-plugins + env: + GOPROXY: direct + GOPRIVATE: github.com/SebastienMelki + + - name: Run proto generation + run: make generate + + - name: Verify generated code is up to date + run: | + if ! git diff --exit-code src/generated/ docs/api/; then + echo "" + echo "============================================================" + echo "ERROR: Proto-generated code is out of date." + echo "Run 'make generate' locally and commit the updated files." + echo "============================================================" + exit 1 + fi + echo "Proto-generated code is up to date."