Skip to content

Commit

Permalink
Divide ruleset into two steps
Browse files Browse the repository at this point in the history
  • Loading branch information
francbartoli committed Feb 20, 2024
1 parent 4fd8d86 commit b58b7d5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,28 @@ jobs:
poetry install
poetry run fastgeoapi openapi
# 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.yaml
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 OAS3
uses: stoplightio/spectral-action@latest
with:
file_glob: "pygeoapi-openapi.json"
spectral_ruleset: ".spectral.oas3.yaml"

# Run Spectral
- name: Run Spectral
# Run Spectral for OWASP Top 10
- name: Run Spectral for OWASP top 10
uses: stoplightio/spectral-action@latest
with:
file_glob: "pygeoapi-openapi.json"
spectral_ruleset: ".spectral.yaml"
spectral_ruleset: ".spectral.owasp-top-10.yaml"
File renamed without changes.
2 changes: 2 additions & 0 deletions .spectral.owasp-top.10.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
extends:
["https://unpkg.com/@stoplight/spectral-owasp-ruleset/dist/ruleset.mjs"]

0 comments on commit b58b7d5

Please sign in to comment.