Skip to content

Sync OpenApi Definitions #853

Sync OpenApi Definitions

Sync OpenApi Definitions #853

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