Skip to content

update-openapi-client #453

update-openapi-client

update-openapi-client #453

name: Update OpenAPI Client and create a PR
on:
repository_dispatch:
types: [update-openapi-client]
workflow_dispatch:
inputs:
version:
description: 'Version string for the update'
default: 'latest'
required: true
type: string
jobs:
generate_openapi_client:
runs-on: ubuntu-latest
steps:
- uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ vars.RAPIDATA_OPENAPI_GENERATOR_APP_ID }}
private-key: ${{ secrets.RAPIDATA_OPENAPI_GENERATOR_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ steps.generate-token.outputs.token }}
- name: Setup node
uses: actions/setup-node@v4
- name: Install node packages
run: npm i -g openapi-merge-cli @openapitools/openapi-generator-cli
- name: Download specs
run: ./openapi/download-and-merge-spec.sh
- name: Generate client
run: ./openapi/generate.sh
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
base: 'main'
branch: 'openapi-generation'
title: 'Update OpenAPI Schemas'
committer: Rudolf the Rabbit <[email protected]>
author: Rudolf the Rabbit <[email protected]>
delete-branch: true
commit-message: 'chore: update OpenAPI client to ${{ inputs.version || github.event.client_payload.latest_tag }}'
token: ${{ steps.generate-token.outputs.token }}
add-paths: |
openapi/output.swagger.json
src/rapidata/api_client/
src/rapidata/api_client_README.md
reviewers: |
kannwism
LinoGiger