diff --git a/.github/workflows/poltergust.yaml b/.github/workflows/poltergust.yaml index 7780648..8bc49c0 100644 --- a/.github/workflows/poltergust.yaml +++ b/.github/workflows/poltergust.yaml @@ -8,6 +8,8 @@ on: jobs: build-and-test-valid-example: + permissions: + contents: write runs-on: ubuntu-latest steps: @@ -23,6 +25,14 @@ jobs: - name: Test the valid example ruleset run: npx poltergust ./examples/valid + - name: Commit updated valid ruleset + run: | + git config --global user.name 'poltergust' + git config --global user.email 'poltergust@users.noreply.github.com' + git commit -am "Auto-update valid ruleset" + git push + + build-and-test-invalid-example: needs: build-and-test-valid-example runs-on: ubuntu-latest diff --git a/examples/invalid/spectral.yaml b/examples/invalid/spectral.yaml deleted file mode 100644 index acb0f24..0000000 --- a/examples/invalid/spectral.yaml +++ /dev/null @@ -1,19 +0,0 @@ -formats: ["oas3"] -extends: "spectral:oas" -aliases: - parameters: - - $.paths[*].parameters - - $.paths[*][*].parameters -#rules will be injected from the rules/*.md files -rules: - base-path-must-start-with-slash: - description: Base path must start with /. - message: "{{description}}. But was {{value}}." - given: $.servers[*] - severity: error - then: - field: url - function: pattern - functionOptions: - match: "^\/" - \ No newline at end of file diff --git a/examples/valid/rules1.md b/examples/valid/rules1.md index e66ca83..f43ef96 100644 --- a/examples/valid/rules1.md +++ b/examples/valid/rules1.md @@ -38,7 +38,7 @@ servers: ```yaml #👻-rule base-path-must-start-with-slash: - description: Base path must start with /. + description: Base path must be relative (start with a /) message: "{{description}}. But was {{value}}." given: $.servers[*] severity: error