New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@useoptic/optic

Package Overview
Dependencies
Maintainers
5
Versions
385
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@useoptic/optic

  • 0.26.22-prerelease-1658344552
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.9K
decreased by-31.17%
Maintainers
5
Weekly downloads
 
Created
Source

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 }} # You will need to connect up your secret here
          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.

# requires nodeJS installed
# install optic-ci in your CI runner
npm i -g @useoptic/optic

# create the context - these will differ between CI providers
optic cloud create-manual-context \\
  --owner <owner>  \\ # the repository owner (in github, this can be an organization or user)
  --repo <repo>  \\ # the repository name
  --pull_request <pull_request>  \\ # the pull request number that this run is associated with
  --run <run>  \\ # the run number that this run is associated with
  --commit_hash <commit_hash>  \\ # the commit hash that this run is associated with
  --branch_name <branch_name>  \\ # the branch name that this run is associated with
  --user <user> # the user that triggered this run

# trigger the optic runner
# base is the branch that you are comparing the OpenAPI Changes against - this defaults to 'origin/master'
OPTIC_TOKEN=<token> optic cloud run --base <base ref>

FAQs

Package last updated on 20 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc