Skip to content

Commit

Permalink
ci: PR增加API breaking change检查 (#1224)
Browse files Browse the repository at this point in the history
根package.json增加`pnpm
api:breaking`命令,可检查api的破坏性更新。并增加一个workflow,专门用于检查破坏性更新。
  • Loading branch information
ddadaal authored Apr 24, 2024
1 parent 55a619e commit 704e4ab
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/api-breaking.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Check SCOW API Breaking Changes

on:
workflow_dispatch:
pull_request:
branches: [master]


jobs:
check-api-breaking-changes:
name: Check SCOW API Breaking Changes
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: bufbuild/buf-setup-action@v1

- name: Check API Compatibility
working-directory: protos
run: buf breaking --against '../.git#branch=origin/master,subdir=protos'
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"lint": "turbo run lint lint:ts",
"lint:ts": "eslint --cache --ext .tsx,.ts,.js .",
"ci:version": "node scripts/version.mjs",
"ci:publish": "pnpm publish -r"
"ci:publish": "pnpm publish -r",
"api:breaking": "cd protos && pnpm exec buf breaking --against '../.git#subdir=protos'"
},
"devDependencies": {
"@bufbuild/buf": "1.30.1",
Expand Down

0 comments on commit 704e4ab

Please sign in to comment.