Skip to content

Commit

Permalink
Merge pull request #25 from katherinelc321/ARO-6276
Browse files Browse the repository at this point in the history
OpenAPI Spec Linting
  • Loading branch information
mjlshen authored Apr 9, 2024
2 parents da858f6 + a40d070 commit 71b9c7a
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/api-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Validate API Spec

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

jobs:
typescript_api_spec_validation:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
fetch-depth: 1

- name: Setup Node.js
uses: actions/setup-node@c2ac33f2c62f978d6c944d9648125a294e56dc0b # v4.0.2
with:
node-version: 'v20.12.0'

- name: Install tsp
run: npm install -g @typespec/[email protected]

- name: Install dependencies
run: npm ci

- name: Install autorest
run: npm install -g [email protected]

- name: Compile tsp
run: tsp compile ./api/redhatopenshift/HcpCluster --warn-as-error

- name: Generate OpenAPI
run: autorest api/autorest-config.yaml

- name: Check for Uncommitted Changes
run: |
git diff --exit-code || (echo "::error::Uncommitted changes detected in OpenAPI spec. Please regenerate and commit them." && exit 1)

0 comments on commit 71b9c7a

Please sign in to comment.