Repository navigation
81 lines (70 loc) · 2.83 KB
/
Copy pathopenapi.yml
File metadata and controls
81 lines (70 loc) · 2.83 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: openapi
on:
push:
branches:
- master
# hack for https://github.com/actions/cache/issues/810#issuecomment-1222550359
env:
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 3
jobs:
build_and_deref_json:
runs-on: ubuntu-24.04
timeout-minutes: 90
permissions:
contents: read
steps:
- name: github app token
id: app-token
uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
with:
app-id: ${{ vars.SENTRY_API_SCHEMA_UPDATER_APP_CLIENT_ID }}
private-key: ${{ secrets.SENTRY_API_SCHEMA_UPDATER_PRIVATE_KEY }}
repositories: |
sentry
sentry-api-schema
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Check for python file changes
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
id: changes
with:
token: ''
filters: .github/file-filters.yml
- name: Setup sentry env
uses: ./.github/actions/setup-sentry
with:
mode: migrations
if: steps.changes.outputs.api_docs == 'true'
- name: Checkout getsentry/sentry-api-schema
if: steps.changes.outputs.api_docs == 'true'
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: 'main'
repository: getsentry/sentry-api-schema
path: sentry-api-schema
# using app token so that `Git Commit & Push` step has the right permissions
# https://github.com/stefanzweifel/git-auto-commit-action/tree/master?tab=readme-ov-file#push-to-protected-branches
token: ${{ steps.app-token.outputs.token }}
- uses: ./.github/actions/setup-node-pnpm
- name: Build OpenAPI Derefed JSON
if: steps.changes.outputs.api_docs == 'true'
run: |
make build-api-docs
- name: Build RPC method schema
if: steps.changes.outputs.api_docs == 'true'
run: |
sentry rpcschema --loglevel=WARNING > rpc_method_schema.json
- name: Copy artifacts into getsentry/sentry-api-schema
if: steps.changes.outputs.api_docs == 'true'
run: |
cp tests/apidocs/openapi-derefed.json sentry-api-schema
cp src/sentry/apidocs/api_ownership_stats_dont_modify.json sentry-api-schema
cp rpc_method_schema.json sentry-api-schema
- name: Git Commit & Push
uses: stefanzweifel/git-auto-commit-action@0049e3fa4059ca715255fbbcb7dea4516f02ce0a # v4.15.3
if: steps.changes.outputs.api_docs == 'true'
with:
repository: sentry-api-schema
branch: main
commit_message: Generated
commit_user_email: 271575301+sentry-api-schema-updater[bot]@users.noreply.github.com
commit_user_name: sentry-api-schema-updater[bot]