From 0f5fc7c74862fcd5c2b69ea0aa86c27e2ba76778 Mon Sep 17 00:00:00 2001 From: Ruben Hensen Date: Mon, 27 Jul 2026 16:10:54 +0200 Subject: [PATCH] ci: add the oasdiff breaking-change gate (cherry picked from commit b2a0cda35e4646797ab2e3e3bc952685236647fb) --- .github/workflows/api-diff.yml | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/api-diff.yml diff --git a/.github/workflows/api-diff.yml b/.github/workflows/api-diff.yml new file mode 100644 index 0000000..ad05d5b --- /dev/null +++ b/.github/workflows/api-diff.yml @@ -0,0 +1,44 @@ +name: API diff +# +# Breaking-change gate on the OpenAPI contract (#196). +# +# Cryptify's routes are unversioned, so there is no way to keep an old shape +# running next to a new one: any breaking change to api-description.yaml +# breaks the clients pinned to it (pg-js, pg-dotnet, the add-ins). This job +# diffs the PR's spec against the branch it targets and fails on anything +# oasdiff rates ERR. Additive changes pass. +# +# To land a genuinely breaking change: add a new versioned route, leave the +# old one in place, and deprecate it once privacybydesign/postguard-ops#64 +# telemetry shows nobody is calling it. +# + +on: + pull_request: + +permissions: + contents: read + +jobs: + + breaking-changes: + name: oasdiff breaking changes + runs-on: ubuntu-latest + steps: + - name: Check out the pull request + uses: actions/checkout@v6 + - name: Check out the base spec + uses: actions/checkout@v6 + with: + ref: ${{ github.event.pull_request.base.sha }} + path: base + - name: Diff the spec against the base branch + uses: oasdiff/oasdiff-action/breaking@v0.1.10 + with: + base: base/api-description.yaml + revision: api-description.yaml + fail-on: ERR + # Do not upload the spec to oasdiff.com for a side-by-side review + # page. The default is `true`; detection and annotations work + # without it, so nothing leaves CI. + review: false