-
Notifications
You must be signed in to change notification settings - Fork 10
38 lines (35 loc) · 1.26 KB
/
linting.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Code linting
on:
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: pre-commit/[email protected]
openapi-breaking-changes:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Clone repo
uses: actions/checkout@v4
with:
# We need the history to find the common ancestor of the PR and the target branch from which we fetch the
# baseline OpenAPI specifications to compare against.
fetch-depth: 0
- name: Fetch baseline OpenAPI specifications
run: |
mergeBase="$(git merge-base --fork-point "origin/${{ github.base_ref }}")"
echo "mergeBase: $mergeBase"
git restore -s "$mergeBase" -W -- model-server-openapi/specifications
cp -R model-server-openapi/specifications model-server-openapi/specifications-before
git checkout model-server-openapi/specifications
- name: Run oasdiff
id: breaking
uses: oasdiff/oasdiff-action/breaking@main
with:
base: 'model-server-openapi/specifications-before/*.yaml'
revision: 'model-server-openapi/specifications/*.yaml'
composed: true