-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
52 lines (49 loc) · 1.6 KB
/
action.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
46
47
48
49
50
51
52
name: Generate SDK Action
description: Generate an SDK using the OpenAPI Generator Project
inputs:
language:
description: The generator name (language) (`-g`) argument for the openapi-generator-cli
required: true
config:
description: The configuration (`-c`) argument for the openapi-generator-cli
required: false
default: ./openapi-config.yml
api-spec-path:
description: The destination of the API Specification to generate a client from
required: false
default: ./bandwidth.yml
openapi-generator-version:
description: The OpenAPI Generator project version, in `x.x.x` format
required: false
default: '7.6.0'
additional-properties:
description: Additional properties to pass to the generator
required: false
default: ''
working-directory:
description: The working directory to run the action in
required: false
default: ./
runs:
using: composite
steps:
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup OpenAPI Generator CLI
run: |
npm install @openapitools/openapi-generator-cli -g
openapi-generator-cli version-manager set ${{ inputs.openapi-generator-version }}
shell: bash
working-directory: ${{ inputs.working-directory }}
- name: Build SDK
run: |
openapi-generator-cli generate \
-g ${{ inputs.language }} \
-i ${{ inputs.api-spec-path }} \
-c ${{ inputs.config }} \
${{ inputs.additional-properties }} \
-o ./
shell: bash
working-directory: ${{ inputs.working-directory }}