Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add readme #8

Merged
merged 1 commit into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
# Upload OpenAPI Specification Action
<div align="center">
<img width="150" height="150" src="https://heyapi.vercel.app/logo.png" alt="Logo">
<h1 align="center"><b>Upload OpenAPI Specification</b></h1>
<p align="center">A GitHub Action that uploads your OpenAPI specifications to Hey API 🚀</p>
</div>

This action will upload your OpenAPI specification to Hey API.
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.

## Usage

Create a new GitHub workflow or add an upload step to your existing workflow inside your API codebase.

```yaml
name: Upload OpenAPI Specification

on:
push:
branches:
- main

jobs:
upload-openapi-spec:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Upload OpenAPI spec
uses: hey-api/upload-openapi-spec@v1
with:
hey-api-token: ${{ secrets.HEY_API_TOKEN }}
path-to-openapi: path/to/openapi.json
```

The example above will send your OpenAPI spec to Hey API on every push to `main` branch.

## Inputs

To successfully upload an OpenAPI specification, you need to provide the following inputs (see `with` in the example above)

### `hey-api-token`

This is the authorization token you obtained from us.

### `path-to-openapi`

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)).

## Next Steps

Please follow the [integrations guide](https://heyapi.vercel.app/openapi-ts/integrations.html) on our website for the next steps.
11 changes: 4 additions & 7 deletions action.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
name: Upload OpenAPI spec
description: Upload your OpenAPI specification to Hey API
author: Hey API

branding:
icon: heart
color: red

icon: file-plus
description: Upload your OpenAPI specification to Hey API
inputs:
dry-run:
description: Run action in dry run mode
Expand All @@ -16,7 +13,7 @@ inputs:
path-to-openapi:
description: Input path to your OpenAPI specification file
required: true

name: Upload OpenAPI spec by Hey API 👋
runs:
using: node20
main: dist/index.js
using: node20