Skip to content
file-plus

GitHub Action

Upload OpenAPI spec by Hey API πŸ‘‹

v1.0.0 Latest version

Upload OpenAPI spec by Hey API πŸ‘‹

file-plus

Upload OpenAPI spec by Hey API πŸ‘‹

Upload your OpenAPI specification to Hey API

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Upload OpenAPI spec by Hey API πŸ‘‹

uses: hey-api/upload-openapi-spec@v1.0.0

Learn more about this action in hey-api/upload-openapi-spec

Choose a version

Logo

Upload OpenAPI Specification

A GitHub Action that uploads your OpenAPI specifications to Hey API πŸš€

To use this action, you have to be registered with Hey API. If you don't have an account, please email us or open an issue 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.

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

Next Steps

Please follow the integrations guide on our website for the next steps.