Skip to content

Commit

Permalink
Split validation steps for openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
francbartoli committed Feb 26, 2024
1 parent f80efa0 commit 6d9b0da
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
build:
name: Run Spectral
name: Build OpenAPI document for pygeoapi configuration and addicted security
runs-on: ubuntu-latest
steps:
# Check out the repository
Expand All @@ -33,24 +33,32 @@ jobs:
poetry install
poetry run fastgeoapi openapi
spectral-oas:
runs-on: ubuntu-latest
needs: build
steps:
# Create OAS3 ruleset
- name: Create OAS 3
run: |
echo 'extends: ["spectral:oas"]' > .spectral.oas3.yaml
# Create OWASP API Security 10 ruleset
- name: Create OWASP API Security 10
run: |
npm install -g @stoplight/spectral-owasp-ruleset@latest
echo 'extends: ["https://unpkg.com/@stoplight/spectral-owasp-ruleset/dist/ruleset.mjs"]' > .spectral.owasp-top-10.yaml
# Run Spectral for OWASP Top 10
# Run Spectral for OAS3
- name: Run Spectral for OAS3
uses: stoplightio/spectral-action@latest
with:
file_glob: "pygeoapi-openapi.json"
spectral_ruleset: ".spectral.oas3.yaml"

spectral-owasp:
runs-on: ubuntu-latest
needs: build
steps:
# Create OWASP API Security 10 ruleset
- name: Create OWASP API Security 10
run: |
npm install -g @stoplight/spectral-owasp-ruleset@latest
echo 'extends: ["https://unpkg.com/@stoplight/spectral-owasp-ruleset/dist/ruleset.mjs"]' > .spectral.owasp-top-10.yaml
# Run Spectral for OWASP Top 10
- name: Run Spectral for OWASP top 10
uses: stoplightio/spectral-action@latest
Expand Down

0 comments on commit 6d9b0da

Please sign in to comment.