-
-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (52 loc) · 1.79 KB
/
schema-changes.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: json-schema-diff
on:
# We run this action on main to get cache artifacts. The json-schema-diff
# binary is not actually run in any way on main.
push:
branches:
- main
pull_request:
env:
JSON_SCHEMA_DIFF_VERSION: 0.1.6
jobs:
post_changes:
name: Post new JSON schema changes from migrations
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
name: Checkout master for diffing
with:
ref: main
- uses: actions/checkout@v3
name: Checkout HEAD of code that may have migration changes
with:
clean: false
- uses: actions/setup-python@v2
with:
python-version: 3.11
- run: make install
- name: Cache json-schema-diff
id: cache-json-schema-diff-bin
uses: actions/cache@v3
with:
path: ~/.cargo/bin/json-schema-diff
key: ${{ runner.os }}-json-schema-diff-bin-v${{ env.JSON_SCHEMA_DIFF_VERSION }}
- name: Download and build json-schema-diff
if: steps.cache-json-schema-diff-bin.outputs.cache-hit != 'true'
run: |
cargo install json-schema-diff \
--version $JSON_SCHEMA_DIFF_VERSION \
--features build-binary
- name: Generate schema diff
if: github.event_name == 'pull_request'
uses: getsentry/action-migrations@v1.2.2
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
useRawBody: "true"
# This parameter determines how comments are deduplicated/reused
migration: "json-schema-changes"
cmd: python ./scripts/json_schema_changes.py --no-exit-code
- name: Fail if any breaking changes found
if: github.event_name == 'pull_request'
run: python ./scripts/json_schema_changes.py