Redocly CI Pipeline Integration: Lint, Bundle, and Push
Quick answer: Add Redocly CLI to the pipeline you already run. Lint the spec on every pull request with --format=github-actions so failures land on the changed lines and block the merge, then bundle and push only after the change reaches main. The same binary runs on your laptop, in CI, and in Docker, so a rule that passes locally is the rule CI applies. Why lint belongs in CI, not just on your…
To integrate Redocly's CI pipeline, simply add the Redocly CLI to your existing pipeline. The CLI will lint the OpenAPI specification on every pull request using the GitHub Actions format, which provides inline annotations on the diff. This allows for fast feedback and prevents bad merges. Once the change is merged to the main branch, the CLI bundles and pushes the specification to the platform, ensuring a consistent rule set across different environments.
By keeping the lint step on pull requests and the bundle and push steps on the main branch, you maintain a secure environment for pushing changes to the platform. The API key is securely stored in the CI secret store and only accessible to the main-branch push job. Finally, linting the bundled artifact ensures that any broken references or circular structures are caught before the artifact is deployed, providing an additional layer of protection for your API's behavior.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to