ci: validate OpenAPI specs on every PR, publish only on master - #207
Merged
Conversation
Add a validate job that runs rdme openapi validate for v1 and v2 specs on every pull request and push. The job fails on any validation error, blocking the PR from being merged. The publish job now depends on validate and only runs on push events (master/main), so ReadMe docs are synced exclusively after changes have landed on the default branch. Bump the rdme action from v8 to v9, which provides the standalone 'openapi validate' command.
Point rdme openapi validate at src.yaml with --workingDirectory so its relative $ref paths (e.g. paths/attachments.yaml) resolve correctly, matching how the publish job syncs the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Split the
publishworkflow into two jobs:validate— runsrdme openapi validatefor the v1 and v2 specs on every pull request and push. It fails on any validation error, which blocks the PR from being merged.publish— nowneeds: validateand is guarded byif: github.event_name == 'push', so ReadMe docs are synced only after changes land onmaster/mainand only when validation passed.Also bumps the
readmeio/rdmeaction from v8 → v9, which ships the standaloneopenapi validatecommand used by the new job.Why
Previously the workflow only ran on push to
master/mainand had no validation step — a broken spec could reach the sync stage. Now spec issues are caught on the PR before merge, and publishing is decoupled from PR runs.Behavior
validateonly (blocks PR on failure)master/mainvalidate→publish