Skip to content

pb33f/vacuum-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

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Official vacuum OpenAPI linter GitHub Action

Got an OpenAPI spec in your repository? Want to lint it with vacuum? This GitHub Action will do just that.

  • Super fast
  • Super simple
  • Super useful

All you need to do is add the action to your repo via a workflow via pb33f/vacuum-action@v2

Here are the configurable properties you can use in your workflow:

Property Type Required Description
openapi_path string true The path to your OpenAPI spec file, relative to the root of your repository.
github_token string true The GitHub token to use for authentication. This is required to post comments on pull requests.
ruleset string false The path to a custom ruleset file, relative to the root of your repository. If not provided, the default ruleset will be used.
show_rules boolean false If set to true, the action will show the rules that were applied. Defaults to false
fail_on_error boolean false If set to true, the action will fail if any errors are detected in the OpenAPI spec. Defaults to true
minimum_score number false The minimum score required to not fail the check. Defaults to 70.
print_logs boolean false If set to true, the action will print the markdown report to the runner logs. Defaults to true

Example Workflow

name: "Lint OpenAPI spec with vacuum"

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

permissions:
  contents: read
  pull-requests: write

jobs:
  vacuum-lint:
    name: Run OpenAPI linting with vacuum
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Run OpenAPI lint with vacuum
        uses: pb33f/vacuum-action@v2
        with:
          openapi_path: "specs/openapi.yaml"
          github_token: ${{ secrets.GITHUB_TOKEN }}

Example Workflow with optional parameters

name: "Lint OpenAPI spec with vacuum"

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

permissions:
  contents: read
  pull-requests: write

jobs:
  vacuum-lint:
    name: Run OpenAPI linting with vacuum
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Run OpenAPI lint with vacuum
        uses: pb33f/vacuum-action@v2
        with:
          openapi_path: "specs/openapi.yaml"
          ruleset: "rulesets/vacuum-ruleset.yaml"
          show_rules: true
          fail_on_error: true
          minimum_score: 90
          print_logs: true
          github_token: ${{ secrets.GITHUB_TOKEN }}

About

The official GitHub action for vacuum, OpenAPI linter

Resources

License

Stars

Watchers

Forks

Packages

No packages published