Skip to content

ci(prod): Release OpenAPI Spec V1 🚀. See https://github.com/mo… #1898

ci(prod): Release OpenAPI Spec V1 🚀. See https://github.com/mo…

ci(prod): Release OpenAPI Spec V1 🚀. See https://github.com/mo… #1898

Workflow file for this run

name: Spectral Lint Commited OpenAPI Spec
# Trigger the workflow on pull requests and pushes to the main branch
on:
pull_request:
paths:
- 'tools/spectral/**'
- 'openapi/**.yaml'
- 'package.json'
push:
branches:
- main
paths:
- 'tools/spectral/**'
- 'openapi/**.yaml'
- 'package.json'
jobs:
spectral-lint:
runs-on: ubuntu-latest
steps:
# Checkout the code
- name: Checkout repository
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
with:
sparse-checkout: |
openapi/
tools/spectral
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: '20.x'
cache: 'npm'
- name: Install npm dependencies
run: npm install
- name: Fetch OAS file from Dev Branch
run: curl -O "https://raw.githubusercontent.com/mongodb/openapi/refs/heads/dev/openapi/.raw/v2.yaml"
working-directory: ${{ github.workspace }}
- name: Spectral action
uses: stoplightio/spectral-action@6416fd018ae38e60136775066eb3e98172143141
with:
# Path to the OpenAPI spec files and openapi/.raw/v2.yaml
file_glob: openapi/.raw/v2.yaml
spectral_ruleset: tools/spectral/.spectral.yaml #If updated, need to update in MMS too.
- name: IPA validation action
run: npx spectral lint v2.yaml --ruleset=./tools/spectral/ipa/ipa-spectral.yaml