Skip to content
Open
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
51 changes: 51 additions & 0 deletions .github/workflows/oasdiff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: oasdiff (OpenAPI breaking-change check)

on:
pull_request:
branches: [master]
paths:
- 'internal/handlers/openapi.go'
- 'go.mod'
- 'go.sum'

permissions:
contents: read
pull-requests: write

jobs:
diff:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout PR
uses: actions/checkout@v4
with:
path: api
- uses: actions/checkout@v4
with:
repository: InstaNode-dev/common
path: common
continue-on-error: true
- uses: actions/checkout@v4
with:
repository: InstaNode-dev/proto
path: proto
continue-on-error: true
- uses: actions/setup-go@v5
with:
go-version-file: api/go.mod
- name: Build openapi.json from PR
working-directory: api
run: |
go run ./cmd/openapi > /tmp/pr-openapi.json 2>/dev/null || \
(go build ./... && ./api --emit-openapi > /tmp/pr-openapi.json 2>/dev/null) || \
echo "WARNING: no openapi-emit binary found; fetching live spec"
- name: Fetch live prod openapi for comparison
run: |
curl -sSfL https://api.instanode.dev/openapi.json -o /tmp/master-openapi.json || \
echo '{"openapi":"3.1.0","paths":{}}' > /tmp/master-openapi.json
- uses: oasdiff/oasdiff-action/breaking@main
with:
base: /tmp/master-openapi.json
revision: /tmp/pr-openapi.json
fail-on-diff: false # warn-only initially; flip to true once known-good baseline exists
Loading