Skip to content

GitHub Action for validating OAS 3.0 or Swagger 2.0 JSON or YAML files using Stoplight Spectral

License

Notifications You must be signed in to change notification settings

ahmetgeymen/spectral-lint-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OAS 3.0 & Swagger 2.0 Lint Action

GitHub Action for validating OAS 3.0 or Swagger 2.0 JSON or YAML files using Stoplight Spectral

CI


Input

file_path: Argument references path of spec file on workspace. (Optional)

In case of absecence, the file named openapi-spec.yml is used by default


Example

You may copy & paste yaml below into your repo under path .github/workflows/oas-spec-lint.yml

name: OAS Linting Action
on:
  push:
    branches: [main]
jobs:
  linting:
    name: Linting
    runs-on: ubuntu-latest
    steps:
      # This action checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it.
      - name: Check out repository
        uses: actions/checkout@v2
    
      # Runs 'spectral lint'
      - name: Run spectral lint
        uses: ahmetgeymen/spectral-lint-action@v1.0
        with:
          file_path: openapi-spec.yml

About

GitHub Action for validating OAS 3.0 or Swagger 2.0 JSON or YAML files using Stoplight Spectral

Topics

Resources

License

Stars

Watchers

Forks