Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: CI

on:
pull_request:
push:
branches: [main]

permissions:
contents: read

jobs:
ci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with:
persist-credentials: false

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install dependencies
run: bun install --frozen-lockfile

- name: Generate protos from BSR
run: bun run generate

- name: Check generated code is in sync
run: |
git add -N src/generated/
if ! git diff --exit-code src/generated/; then
echo "::error::src/generated/ is out of sync with buf.build/photon-hq/whatsapp — run 'bun run generate' and commit the result."
exit 1
fi
Comment thread
invisicat marked this conversation as resolved.

- name: Type-check
run: bun run check

- name: Lint
run: bun run lint

- name: Test
run: bun test

- name: Build
run: bun run build
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The webhook endpoint is free, public, and shared across all developers. You don'

```bash
bun install # install dependencies
bun run generate # regenerate protobuf types
bun run generate # regenerate protobuf types from buf.build/photon-hq/whatsapp
bun run build # generate + bundle with tsup
bun run check # type-check
bun run lint # lint with Biome
Expand Down
4 changes: 4 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
version: v2
inputs:
# Pinned BSR commit (main @ spectrum-whatsapp-business 17e7e9c).
# To pick up schema changes: update the ref, run `bun run generate`, commit both.
- module: buf.build/photon-hq/whatsapp:b218d3336d65421c8b215137797db344

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale generated files evade sync check

Medium Severity

buf generate now pulls a remote BSR module, and CI treats a clean git diff on src/generated/ as proof of sync, but buf.gen.yaml does not set clean: true. If a later pin drops or renames protos, old generated files stay on disk untouched, so the sync check still passes and stale types can ship.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 4acb471. Configure here.

plugins:
- local: protoc-gen-ts_proto
out: src/generated
Expand Down
6 changes: 0 additions & 6 deletions buf.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
}
},
"files": [
"dist",
"proto"
"dist"
],
"engines": {
"node": ">=18"
Expand Down
27 changes: 0 additions & 27 deletions proto/photon/whatsapp/v1/common.proto

This file was deleted.

40 changes: 0 additions & 40 deletions proto/photon/whatsapp/v1/media_service.proto

This file was deleted.

Loading
Loading