-
Notifications
You must be signed in to change notification settings - Fork 8
65 lines (53 loc) · 2.18 KB
/
sync-openapi-definitions.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
59
60
61
62
63
64
65
name: Sync OpenApi Definitions
on:
schedule:
# At the end of every day
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
sync:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Sync Account API spec
run: curl -o static/openapi/account.json https://api.stubhub.net/v2/openapi/account.json
- name: Sync Catalog API spec
run: curl -o static/openapi/catalog.json https://api.stubhub.net/catalog/openapi/openapi.json
- name: Sync Inventory API spec
run: curl -o static/openapi/inventory.json https://api.stubhub.net/v2/openapi/inventory.json
- name: Sync Sales API spec
run: curl -o static/openapi/sales.json https://api.stubhub.net/v2/openapi/sales.json
- name: Sync Webhooks API spec
run: curl -o static/openapi/webhooks.json https://api.stubhub.net/v2/openapi/webhooks.json
- name: Find and Replace logo URLs
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "https://img.vggcdn.net/img/assets/logo/viagogo_logo_apidocs.png"
replace: "https://img.vggcdn.net/images/Assets/Icons/bfx/stubhub-logo-merch-purple-mweb.440b3765.svg"
include: "static/openapi/**"
regex: false
- name: Find and Replace viagogo in URLs
uses: jacobtomlinson/gha-find-replace@v2
with:
find: ".viagogo."
replace: ".stubhub."
include: "static/openapi/**"
regex: false
- name: Find and Replace viagogo everywhere else
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "viagogo"
replace: "StubHub"
include: "static/openapi/**"
regex: false
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: "Sync latest changes to OpenAPI definitions"
body: "Automated changes by `.github/workflows/sync-openapi-definitions.yml`"
reviewers: "akilburge"
branch: "sync-openapi-definitions/patch"
delete-branch: true