Skip to content

Commit 0f5fc7c

Browse files
committed
ci: add the oasdiff breaking-change gate
(cherry picked from commit b2a0cda)
1 parent ef51da2 commit 0f5fc7c

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/api-diff.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: API diff
2+
#
3+
# Breaking-change gate on the OpenAPI contract (#196).
4+
#
5+
# Cryptify's routes are unversioned, so there is no way to keep an old shape
6+
# running next to a new one: any breaking change to api-description.yaml
7+
# breaks the clients pinned to it (pg-js, pg-dotnet, the add-ins). This job
8+
# diffs the PR's spec against the branch it targets and fails on anything
9+
# oasdiff rates ERR. Additive changes pass.
10+
#
11+
# To land a genuinely breaking change: add a new versioned route, leave the
12+
# old one in place, and deprecate it once privacybydesign/postguard-ops#64
13+
# telemetry shows nobody is calling it.
14+
#
15+
16+
on:
17+
pull_request:
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
24+
breaking-changes:
25+
name: oasdiff breaking changes
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Check out the pull request
29+
uses: actions/checkout@v6
30+
- name: Check out the base spec
31+
uses: actions/checkout@v6
32+
with:
33+
ref: ${{ github.event.pull_request.base.sha }}
34+
path: base
35+
- name: Diff the spec against the base branch
36+
uses: oasdiff/oasdiff-action/breaking@v0.1.10
37+
with:
38+
base: base/api-description.yaml
39+
revision: api-description.yaml
40+
fail-on: ERR
41+
# Do not upload the spec to oasdiff.com for a side-by-side review
42+
# page. The default is `true`; detection and annotations work
43+
# without it, so nothing leaves CI.
44+
review: false

0 commit comments

Comments
 (0)