Skip to content

Commit

Permalink
added linter workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Long Le authored and Long Le committed Sep 9, 2024
1 parent 4e526cf commit 139deb4
Show file tree
Hide file tree
Showing 3 changed files with 509 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/tyk-schema-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,20 @@ name: Tyk Schema Validation
# Perform the Tyk schema validation only on PR requests
on:
pull_request:
branches: [ main ]
paths:
- 'stg/**'
- 'prod/**'
workflow_dispatch:
inputs:
environment:
type: choice
options:
- stg
- prod
workflow_call:
inputs:
environment:
type: string

jobs:
schema-validation:
Expand All @@ -31,8 +44,15 @@ jobs:
run: |
which jq
jq --version
# Execute Spectral / Stoplight plugin to validate Tyk APIs
- uses: stoplightio/spectral-action@latest
with:
file_glob: infrastructure/${{ env.environment }}/apis/api-*.json
spectral_ruleset: infrastructure/${{ env.environment }}/tykapi-ruleset.yaml
continue-on-error: false

# Governance to validate minimum required fields
# Tyk API Linting and API Governance for Minimum Required Fields
- name: 'Validate min fields for APIs and Policies'
run: |
cd ./dev
Expand Down
Loading

0 comments on commit 139deb4

Please sign in to comment.