on-oas-updated #57
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate TypeScript API client | |
on: | |
repository_dispatch: | |
types: [on-oas-updated] | |
jobs: | |
generate: | |
name: Generate TS client | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download OpenAPI document | |
run: | | |
mkdir -p tmp | |
curl https://raw.githubusercontent.com/Apicurio/apicurio-registry/master/${{ github.event.client_payload.openapi_file_path }} > tmp/input-schema.json | |
- name: Preprocess input schema | |
run: bash <(curl -s https://raw.githubusercontent.com/Apicurio/apicurio-registry-client-sdk-go/main/hack/scripts/preprocess-schema.sh) | |
- name: Delete old generated code | |
run: | | |
rm -rf src | |
- uses: craicoverflow/openapi-generator-action@v1 | |
with: | |
generator: typescript-axios | |
input: tmp/input-schema.json | |
output: src | |
additional-properties: "supportsES6=true,typescriptThreePlus=true" | |
ignore-file-override: .openapi-generator-ignore | |
- name: Clean up temp files | |
run: rm -fr tmp | |
- uses: dorny/paths-filter@v2 | |
id: changes | |
with: | |
filters: | | |
generated: | |
- '**' | |
- name: Create Pull Request | |
if: steps.changes.outputs.generated == 'true' | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
delete-branch: true | |
branch-suffix: short-commit-hash | |
branch: generate-sdk | |
team-reviewers: '@Apicurio/developers' | |
title: "[generated] Update API client" | |
commit-message: "chore: update API client" | |
body: | | |
Automated update of the Apicurio Registry SDK |