-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (40 loc) · 1.39 KB
/
regenerate.yml
File metadata and controls
47 lines (40 loc) · 1.39 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
name: Regenerate Client
on:
workflow_dispatch:
jobs:
regenerate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@v2
with:
app-id: 3060111
private-key: ${{ secrets.HOTDATA_AUTOMATION_PRIVATE_KEY }}
owner: hotdata-dev
- name: Fetch merged OpenAPI spec
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
curl -sS -f -L \
-H "Accept: application/vnd.github.v3.raw" \
-H "Authorization: Bearer $GH_TOKEN" \
https://api.github.com/repos/hotdata-dev/www.hotdata.dev/contents/api/openapi.yaml \
-o openapi.yaml
- name: Clean existing source
run: rm -rf src/
- name: Generate client
run: |
npx @openapitools/openapi-generator-cli generate \
-i openapi.yaml \
-g python \
-o . \
--additional-properties=packageName=hotdata,projectName=hotdata
- name: Create PR
uses: peter-evans/create-pull-request@v6
with:
title: "chore: regenerate client from updated OpenAPI spec"
branch: openapi-update
commit-message: "chore: regenerate client from OpenAPI spec"
body: "Auto-generated from updated HotData OpenAPI spec."