You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A GitHub Action for pushing your OpenAPI spec to [Stainless](https://stainless.com/) to trigger regeneration of your SDKs.
10
+
A CI component for pushing your OpenAPI spec to [Stainless](https://stainless.com/) to trigger regeneration of your SDKs. Supports both GitHub Actions and GitLab CI.
11
11
12
12
Note that there is currently a manual step in between this action and automatic creation of your PR's,
13
13
and more manual steps before they are merged and released.
@@ -18,7 +18,11 @@ so that your API reference documentation can show examples of making each reques
18
18
19
19
## Example usage
20
20
21
-
First, obtain an API Key from your Stainless dashboard, and [add it to your GitHub Actions secrets](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) as `STAINLESS_API_KEY`:
21
+
First, obtain an API Key from your Stainless dashboard.
22
+
23
+
### GitHub Actions
24
+
25
+
For GitHub Actions, [add the API key to your repository secrets](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) as `STAINLESS_API_KEY`:
22
26
23
27
```
24
28
gh secret set STAINLESS_API_KEY
@@ -50,6 +54,29 @@ jobs:
50
54
51
55
You can optionally add `config_path: 'path/to/my-company.stainless.yaml'` to the `with:` block if you'd like to send us updates to your Stainless config.
52
56
57
+
### GitLab CI
58
+
59
+
For GitLab CI, add the API key to your [GitLab CI/CD variables](https://docs.gitlab.com/ee/ci/variables/#add-a-cicd-variable-to-a-project) as `STAINLESS_API_KEY`.
60
+
61
+
Then, add the following to your `.gitlab-ci.yml` file:
You can identify your Stainless project name on the [Stainless dashboard](https://app.stainless.com/).
54
81
55
82
### Optional parameters
@@ -75,7 +102,9 @@ openapi:
75
102
code_samples: readme
76
103
```
77
104
78
-
Then configure your GitHub Action to upload the Stainless-enhanced OpenAPI spec to ReadMe:
105
+
### GitHub Actions with ReadMe
106
+
107
+
Configure your GitHub Action to upload the Stainless-enhanced OpenAPI spec to ReadMe:
79
108
80
109
```yaml
81
110
name: Upload OpenAPI spec to Stainless and ReadMe
@@ -111,6 +140,7 @@ This assumes the following secrets have been [uploaded to your GitHub Actions Se
111
140
112
141
Remember to set the `readmeio/rdme` ref version to the latest stable available (`v8`, as of this writing). You can verify the latest version of ReadMe's GitHub Action [here](https://github.com/marketplace/actions/rdme-sync-to-readme).
113
142
143
+
114
144
## Usage with Mintlify for docs with example snippets
115
145
116
146
If you use Mintlify's OpenAPI support for your API reference documentation,
@@ -121,7 +151,11 @@ openapi:
121
151
code_samples: mintlify
122
152
```
123
153
124
-
Mintlify can generate your docs based on the OpenAPI spec in your docs repo if it is [configured to do so](https://mintlify.com/docs/api-playground/openapi/setup#in-the-repo). To integrate Stainless, you can modify the GitHub Action that uploads your OpenAPI spec to Stainless such that it then pushes the Stainless-enhanced OpenAPI spec into your docs repo:
154
+
Mintlify can generate your docs based on the OpenAPI spec in your docs repo if it is [configured to do so](https://mintlify.com/docs/api-playground/openapi/setup#in-the-repo).
155
+
156
+
### GitHub Actions with Mintlify
157
+
158
+
To integrate Stainless with your GitHub Actions workflow:
125
159
126
160
```yaml
127
161
name: Upload OpenAPI spec to Stainless and (Mintlify) docs repo
@@ -161,3 +195,4 @@ This assumes the following secrets have been [uploaded to your GitHub Actions Se
161
195
162
196
- `secrets.STAINLESS_API_KEY`: Your Stainless API key.
163
197
- `secrets.API_TOKEN_GITHUB`: A GitHub [Personal Access Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) with permissions to push to your docs repo.
Copy file name to clipboardExpand all lines: action.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
name: Stainless — Upload OpenAPI specification
2
-
description: Upload your OpenAPI spec to update your Stainless SDKs (and, if configured, add example snippets to your API docs)
2
+
description: Upload your OpenAPI spec to update your Stainless SDKs (and, if configured, add example snippets to your API docs). Works with GitHub Actions and GitLab CI.
0 commit comments