File tree Expand file tree Collapse file tree 5 files changed +55
-0
lines changed Expand file tree Collapse file tree 5 files changed +55
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Generate API Client
2
+ on :
3
+ schedule :
4
+ - cron : ' 0 8 * * *'
5
+ workflow_dispatch :
6
+
7
+ jobs :
8
+ gen-api :
9
+ timeout-minutes : 30
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - name : Checkout
13
+ uses : actions/checkout@v3
14
+ with :
15
+ token : ${{ secrets.GH_CQ_BOT }}
16
+
17
+ - name : Get Specs File
18
+ run : |
19
+ curl -H "Authorization: token ${{ secrets.GH_CQ_BOT }}" https://raw.githubusercontent.com/cloudquery/cloud/main/internal/servergen/spec.json -o spec.json
20
+
21
+ - name : Set up Go 1.x
22
+ uses : actions/setup-go@v3
23
+ with :
24
+ go-version-file : go.mod
25
+
26
+ - name : Regenerate client
27
+ run : |
28
+ go generate ./...
29
+
30
+ - name : Create Pull Request
31
+ uses : peter-evans/create-pull-request@v5
32
+ with :
33
+ # required so the PR triggers workflow runs
34
+ token : ${{ secrets.GH_CQ_BOT }}
35
+ branch : fix/gen-cloudquery-api
36
+ base : main
37
+ title : ' fix: Generate CloudQuery Go API Client from `spec.json`'
38
+ commit-message : ' fix: Generate CloudQuery Go API Client from `spec.json`'
39
+ body : This PR was created by a scheduled workflow to generate the CloudQuery Go API Client from `spec.json`
40
+ author : cq-bot <cq-bot@users.noreply.github.com>
41
+ labels : automerge
Original file line number Diff line number Diff line change
1
+ //go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.13.3 --config=./models.yaml ./spec.json
2
+ //go:generate go run github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v1.13.3 --config=./client.yaml ./spec.json
3
+ package cloudquery_api
Original file line number Diff line number Diff line change
1
+ package : cloudquery_api
2
+ generate :
3
+ client : true
4
+ output : client.gen.go
Original file line number Diff line number Diff line change
1
+ module github.com/cloudquery/cloudquery-api-go
2
+
3
+ go 1.21.0
Original file line number Diff line number Diff line change
1
+ package : cloudquery_api
2
+ generate :
3
+ models : true
4
+ output : models.gen.go
You can’t perform that action at this time.
0 commit comments