Skip to content

Commit 11218c2

Browse files
authored
Merge pull request #8 from hey-api/docs/readme
docs: add readme
2 parents a403c11 + 0b2e1dd commit 11218c2

File tree

2 files changed

+54
-9
lines changed

2 files changed

+54
-9
lines changed

README.md

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,51 @@
1-
# Upload OpenAPI Specification Action
1+
<div align="center">
2+
<img width="150" height="150" src="https://heyapi.vercel.app/logo.png" alt="Logo">
3+
<h1 align="center"><b>Upload OpenAPI Specification</b></h1>
4+
<p align="center">A GitHub Action that uploads your OpenAPI specifications to Hey API 🚀</p>
5+
</div>
26

3-
This action will upload your OpenAPI specification to Hey API.
7+
To use this action, you have to be registered with [Hey API](https://heyapi.vercel.app/). If you don't have an account, please [email us](mailto:[email protected]) or [open an issue](https://github.com/hey-api/upload-openapi-spec/issues) and we will set you up.
8+
9+
## Usage
10+
11+
Create a new GitHub workflow or add an upload step to your existing workflow inside your API codebase.
12+
13+
```yaml
14+
name: Upload OpenAPI Specification
15+
16+
on:
17+
push:
18+
branches:
19+
- main
20+
21+
jobs:
22+
upload-openapi-spec:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Upload OpenAPI spec
29+
uses: hey-api/upload-openapi-spec@v1
30+
with:
31+
hey-api-token: ${{ secrets.HEY_API_TOKEN }}
32+
path-to-openapi: path/to/openapi.json
33+
```
34+
35+
The example above will send your OpenAPI spec to Hey API on every push to `main` branch.
36+
37+
## Inputs
38+
39+
To successfully upload an OpenAPI specification, you need to provide the following inputs (see `with` in the example above)
40+
41+
### `hey-api-token`
42+
43+
This is the authorization token you obtained from us.
44+
45+
### `path-to-openapi`
46+
47+
A relative path to your OpenAPI spec file within the repository. Note that you might need an additional step in your GitHub workflow to generate this file (see [FastAPI example](https://fastapi.tiangolo.com/how-to/extending-openapi/#generate-the-openapi-schema)).
48+
49+
## Next Steps
50+
51+
Please follow the [integrations guide](https://heyapi.vercel.app/openapi-ts/integrations.html) on our website for the next steps.

action.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
name: Upload OpenAPI spec
2-
description: Upload your OpenAPI specification to Hey API
31
author: Hey API
4-
52
branding:
6-
icon: heart
73
color: red
8-
4+
icon: file-plus
5+
description: Upload your OpenAPI specification to Hey API
96
inputs:
107
dry-run:
118
description: Run action in dry run mode
@@ -16,7 +13,7 @@ inputs:
1613
path-to-openapi:
1714
description: Input path to your OpenAPI specification file
1815
required: true
19-
16+
name: Upload OpenAPI spec by Hey API 👋
2017
runs:
21-
using: node20
2218
main: dist/index.js
19+
using: node20

0 commit comments

Comments
 (0)