-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (39 loc) · 1.52 KB
/
gen-client.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
name: Generate API Client
on:
workflow_dispatch:
jobs:
gen-api:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_CQ_BOT }}
- name: Get Specs File
run: |
curl -H "Authorization: token ${{ secrets.GH_CQ_BOT }}" https://raw.githubusercontent.com/cloudquery/cloud/main/internal/servergen/spec.json -o spec.json
- name: Format Specs File
run: |
docker run --rm -v $(pwd):/local openapitools/openapi-generator-cli:v7.5.0 generate -i /local/spec.json -g openapi --skip-validate-spec -o /local/.generated
cp .generated/openapi.json spec.json
sudo rm -rf .generated
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version-file: go.mod
- name: Regenerate client
run: |
go generate ./...
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
# required so the PR triggers workflow runs
token: ${{ secrets.GH_CQ_BOT }}
branch: fix/gen-cloudquery-api
base: main
title: 'fix: Generate CloudQuery Go API Client from `spec.json`'
commit-message: 'fix: Generate CloudQuery Go API Client from `spec.json`'
body: This PR was created by a scheduled workflow to generate the CloudQuery Go API Client from `spec.json`
author: cq-bot <[email protected]>
labels: automerge