From b6ba678381a5bf77d3c9a1a86c7181c2f2260428 Mon Sep 17 00:00:00 2001 From: Dmitrii Gridnev Date: Tue, 14 Jul 2026 21:01:27 +0300 Subject: [PATCH 1/2] ci: validate OpenAPI specs on every PR, publish only on master 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. --- .github/workflows/readme.yaml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/readme.yaml b/.github/workflows/readme.yaml index ac861b8..5dd938b 100644 --- a/.github/workflows/readme.yaml +++ b/.github/workflows/readme.yaml @@ -5,20 +5,39 @@ on: branches: - master - main + pull_request: jobs: + validate: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Validate OpenAPI spec for v1 + uses: readmeio/rdme@v9 + with: + rdme: openapi validate ./testops-api/v1/src.yaml + + - name: Validate OpenAPI spec for v2 + uses: readmeio/rdme@v9 + with: + rdme: openapi validate ./testops-api/v2/src.yaml + publish: + needs: validate + if: github.event_name == 'push' runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Sync Readme docs for v1 - uses: readmeio/rdme@v8 + uses: readmeio/rdme@v9 with: rdme: openapi ./src.yaml --version=v1.0.0 --key=${{ secrets.README_KEY }} --id=6172e1f931427d3f983e34ff --workingDirectory=./testops-api/v1 - name: Sync Readme docs for v2 - uses: readmeio/rdme@v8 + uses: readmeio/rdme@v9 with: rdme: openapi ./src.yaml --version=v2.0.0 --key=${{ secrets.README_KEY }} --id=65b3b5175f1e14007198cbc8 --workingDirectory=./testops-api/v2 From 73a84fa2d24b61b99348e01c56917fb72c6e4188 Mon Sep 17 00:00:00 2001 From: Dmitrii Gridnev Date: Tue, 14 Jul 2026 21:32:40 +0300 Subject: [PATCH 2/2] ci: run spec validation from the spec working directory 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. --- .github/workflows/readme.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/readme.yaml b/.github/workflows/readme.yaml index 5dd938b..53798ce 100644 --- a/.github/workflows/readme.yaml +++ b/.github/workflows/readme.yaml @@ -17,12 +17,12 @@ jobs: - name: Validate OpenAPI spec for v1 uses: readmeio/rdme@v9 with: - rdme: openapi validate ./testops-api/v1/src.yaml + rdme: openapi validate ./src.yaml --workingDirectory=./testops-api/v1 - name: Validate OpenAPI spec for v2 uses: readmeio/rdme@v9 with: - rdme: openapi validate ./testops-api/v2/src.yaml + rdme: openapi validate ./src.yaml --workingDirectory=./testops-api/v2 publish: needs: validate