Skip to content

Spectral manual run

Spectral manual run #1

---
# CAMARA Project - workflow configuration to manually run CAMARA OAS rules
# see https://docs.github.com/en/actions/using-workflows/manually-running-a-workflow
# 31.01.2024 - initial version
name: Spectral manual run
on: workflow_dispatch
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
build:
name: Spectral linting
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push, comment issues & post new PR
# Remove the ones you do not need
contents: write
issues: write
pull-requests: write
steps:
# Git Checkout
- name: Checkout Code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # If you use VALIDATE_ALL_CODEBASE = true, you can remove this line to improve performances
- name: Install Spectral
run: npm install -g @stoplight/spectral
- name: Install Spectral functions
run: npm install -g @stoplight/spectral-functions
- name: Run Spectral linting
run: spectral lint code/API_definitions/*.yaml --verbose --ruleset .spectral.yml