Running Spectral lint in Gitlab CI
In my Makefile, I check for OpenAPI spec issues with this command: docker run –rm -it -v $(PWD):/tmp stoplight/spectral lint \ –ruleset /tmp/spec/.spectral.yaml /tmp/spec/openapi.yaml When running in GitLab CI, we set the image to stoplight/spectral:latest, and override the entry point so that we can run spectral directly: openapi-lint: stage: test image: name: stoplight/spectral:latest entrypoint: [""] script: – spectral lint –ruleset spec/.spectral.yaml spec/openapi.yaml Note that GitLab's CI running automatically sets the current working directly to the… continue reading.