Optic
Optic CI helps you review OpenAPI specs and enforce API standards. Sign up on app.useoptic.com to get a token and get started.
Setup Optic in CI
GitHub Actions
Optic comes with a GitHub Action for easy setup and configuration. The Optic GitHub Action can be configured in your .github/workflows/optic-ci.yml
file. An example snippet is listed below.
name: Optic
on: [pull_request]
jobs:
optic-run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: optic run
uses: opticdev/github-action@v1
with:
token: ${{ secrets.OPTIC_TOKEN }}
base: ${{ github.event.pull_request.base.ref }}
Other CI Providers
You can manually connect up Optic using any other CI provider by calling optic directly. An example implementation in bash is listed below, where each step command can be broken out into different CI steps.
npm i -g @useoptic/optic
optic cloud create-manual-context \\
--owner <owner> \\
--repo <repo> \\
--pull_request <pull_request> \\
--run <run> \\
--commit_hash <commit_hash> \\
--branch_name <branch_name> \\
--user <user>
OPTIC_TOKEN=<token> optic cloud run --base <base ref>