diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index f8e1c83d7..aed1b4e87 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -29,14 +29,14 @@ jobs: with: go-version-file: go.mod - - name: Lint + - name: Lint go code uses: golangci/golangci-lint-action@v6 with: args: --timeout=30m version: v1.60 - shell: bash - - name: Run Vacuum - run: | - go run github.com/daveshanley/vacuum@latest lint -d api/webhook.yaml - shell: bash + # Run Spectral + - name: Lint OpenAPI spec + uses: stoplightio/spectral-action@2ad0b9302e32a77c1caccf474a9b2191a8060d83 # v0.8.11 + with: + file_glob: 'api/*.yaml' diff --git a/.spectral.yaml b/.spectral.yaml new file mode 100644 index 000000000..d47c47d31 --- /dev/null +++ b/.spectral.yaml @@ -0,0 +1 @@ +extends: ["spectral:oas"] diff --git a/Makefile b/Makefile index 0c22b0096..7eee8f411 100644 --- a/Makefile +++ b/Makefile @@ -60,8 +60,9 @@ licensecheck: exit 1; \ fi +# Requires to install spectral. See https://github.com/stoplightio/spectral oas-lint: - go run github.com/daveshanley/vacuum@latest lint -d api/webhook.yaml + spectral lint api/*.yaml # Run all the linters .PHONY: lint diff --git a/api/webhook.yaml b/api/webhook.yaml index ac7cb2d36..c0c4f16aa 100644 --- a/api/webhook.yaml +++ b/api/webhook.yaml @@ -1,7 +1,7 @@ --- openapi: "3.0.0" info: - version: 0.14.0 + version: v0.15.0 title: External DNS Webhook Server description: >- Implements the external DNS webhook endpoints. @@ -44,7 +44,7 @@ paths: - example.com '500': description: | - Failed to provide the list of domains we serve. + Negociation failed. /records: get: diff --git a/provider/webhook/webhook_test.go b/provider/webhook/webhook_test.go index 470c3caf5..999cdc3bf 100644 --- a/provider/webhook/webhook_test.go +++ b/provider/webhook/webhook_test.go @@ -162,6 +162,7 @@ func TestAdjustEndpoints(t *testing.T) { } j, _ := json.Marshal(endpoints) w.Write(j) + })) defer svr.Close()