-
Notifications
You must be signed in to change notification settings - Fork 6
/
action.yml
201 lines (201 loc) · 8.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# action.yml
name: Speakeasy SDK Workflow Runner Action
description: The Speakeasy Generation Action is to be run via the workflows provided in this repo and is not intended to be run directly.
inputs:
speakeasy_version:
description: The version of the Speakeasy CLI to use or "latest"
default: latest
required: false
github_access_token:
description: A GitHub access token with write access to the repo
required: true
speakeasy_api_key:
description: "The Speakeasy API key to authenticate the Speakeasy CLI with"
required: true
openapi_doc_auth_token:
description: "An auth token to authenticate with a private OpenAPI spec"
required: false
force:
description: "Force the SDK to be regenerated"
default: "false"
required: false
sources:
description: "The sources to tag (comma or newline separated)"
required: false
target:
description: "Generate a specific target by name"
required: false
code_samples:
description: "The targets to tag code samples for (comma or newline separated)"
required: false
registry_tags:
description: "Multi-line or single-line string input of tags to apply to speakeasy registry builds"
required: false
max_suggestions:
description: "The maximum number of suggestions to apply when using the 'suggest' action step."
default: "5"
required: false
mode:
description: |-
The mode to run the workflow in when using the 'generate' action, valid options are 'direct' or 'pr', defaults to 'direct'.
This is intended to be used along with the `action` input to determine the current action step to run.
- 'direct' mode will generally create a branch to generate the SDK on then merge this directly to the branch the workflow is configure to run on (normally 'main' or 'master') after compilation is successful.
- 'pr' will create a branch to generate the SDK on then create a pull request to merge this branch to the branch the workflow is configure to run on (normally 'main' or 'master') after compilation is successful.
See documentation for more details.
default: "direct"
required: false
action:
description: |-
The current action step to run, valid options are 'run-workflow', 'release', or 'tag', defaults to 'run-workflow'.
This is intended to be used along with the `mode` input to determine the current action step to run.
- 'run-workflow' will generate the SDK and commit the changes to the branch.
- 'release' will create a release on Github.
- 'tag' will tag the registry images with the provided tags.
branch_name:
description: "The name of the branch to finalize, only used for the 'finalize' action step."
required: false
cli_output:
description: "Output of `speakeasy suggest` CLI command, only used for the 'finalize-suggestion' action step."
required: false
previous_gen_version:
description: "The version of the previous generation, only used for the 'finalize' action step."
required: false
output_tests:
description: "Internal use only"
required: false
speakeasy_server_url:
description: "Internal use only"
required: false
openai_api_key:
description: "The OpenAI API key to authenticate to access LLM suggestions. If left empty it will use Speakeasy's key within platform limits."
required: false
working_directory:
description: "The working directory for running Speakeasy CLI commands in the action"
required: false
gpg_fingerprint:
description: "The GPG fingerprint to sign the release with"
required: false
push_code_samples_only:
description: "This will generate code samples, tag them with the `main` branch name, and push them to the registry. It will not create a pull request or commit any code. This is useful for pushing up some code samples to the registry the first time when there are no code samples in the registry."
required: false
target_directory:
description: "The directory the SDK target was generated to"
required: false
registry_name:
description: "The name of the publishing registry"
required: false
set_version:
description: "Version to manually set for SDK generation"
required: false
cli_environment_variables:
description: |
Extra environment variables to set for the speakeasy run execution.
required: false
pnpm_version:
description: "Version of pnpm to install. Not recommended for use without consulting Speakeasy support."
required: false
outputs:
publish_python:
description: "Whether the Python SDK will be published to PyPi"
publish_typescript:
description: "Whether the Typescript SDK will be published to NPM"
publish_terraform:
description: "Whether the Terraform Provider will be published to the Terraform Registry"
publish_php:
description: "Whether the PHP SDK will be published to Packagist this will also create a release on Github"
publish_ruby:
description: "Whether the Ruby SDK will be published to Rubygems"
publish_java:
description: "Whether the Java SDK will be published to the provided OSSRH URL"
publish_csharp:
description: "Whether the C# SDK will be published to Nuget"
python_regenerated:
description: "true if the Python SDK was regenerated"
python_directory:
description: "The directory the Python SDK was generated to"
typescript_regenerated:
description: "true if the Typescript SDK was regenerated"
typescript_directory:
description: "The directory the Typescript SDK was generated to"
go_regenerated:
description: "true if the Go SDK was regenerated"
go_directory:
description: "The directory the Go SDK was generated to"
java_regenerated:
description: "true if the Java SDK was regenerated"
java_directory:
description: "The directory the Java SDK was generated to"
terraform_regenerated:
description: "true if the Terraform Provider was regenerated"
terraform_directory:
description: "The directory the Terraform Provider was generated to"
php_regenerated:
description: "true if the PHP SDK was regenerated"
php_directory:
description: "The directory the PHP SDK was generated to"
ruby_regenerated:
description: "true if the Ruby SDK was regenerated"
ruby_directory:
description: "The directory the Ruby SDK was generated to"
csharp_regenerated:
description: "true if the C# SDK was regenerated"
csharp_directory:
description: "The directory the C# SDK was generated to"
unity_regenerated:
description: "true if the Unity SDK was regenerated"
unity_directory:
description: "The directory the Unity SDK was generated to"
swift_regenerated:
description: "true if the Swift SDK was regenerated"
swift_directory:
description: "The directory the Swift SDK was generated to"
docs_regenerated:
description: "true if SDK docs were regenerated"
docs_directory:
description: "The directory the SDK docs was generated to"
branch_name:
description: "The name of the branch the SDK was generated or spec was modified on"
cli_output:
description: "Output of the CLI command issued in the `suggest` action"
commit_hash:
description: "The commit hash of the merge commit into main if using 'direct' mode"
previous_gen_version:
description: "The version of the previous generation"
openapi_doc:
description: "The location of the OpenAPI document used for generation"
registry_name:
description: "The name of the publishing registry"
target_directory:
description: "The directory the SDK target was generated to"
runs:
using: "docker"
image: "docker://ghcr.io/speakeasy-api/sdk-generation-action:v15"
env:
SPEAKEASY_API_KEY: ${{ inputs.speakeasy_api_key }}
SPEAKEASY_SERVER_URL: ${{ inputs.speakeasy_server_url }}
OPENAI_API_KEY: ${{ inputs.openai_api_key }}
OPENAPI_DOC_AUTH_TOKEN: ${{ inputs.openapi_doc_auth_token }}
args:
- ${{ inputs.speakeasy_version }}
- ${{ inputs.github_access_token }}
- ${{ inputs.docs_languages }}
- ${{ inputs.max_suggestions }}
- ${{ inputs.mode }}
- ${{ inputs.action }}
- ${{ inputs.branch_name }}
- ${{ inputs.cli_output }}
- ${{ inputs.previous_gen_version }}
- ${{ inputs.openapi_doc_output }}
- ${{ inputs.output_tests }}
- ${{ inputs.working_directory }}
- ${{ inputs.gpg_fingerprint }}
- ${{ inputs.openapi_doc_auth_token }}
- ${{ inputs.target }}
- ${{ inputs.registry_tags }}
- ${{ inputs.registry_name }}
- ${{ inputs.target_directory }}
- ${{ inputs.sources }}
- ${{ inputs.code_samples }}
- ${{ inputs.set_version }}
- ${{ inputs.cli_environment_variables }}
- ${{ inputs.pnpm_version }}