diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b6e1c95f8..9ee849d40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,6 +88,21 @@ jobs: with: rdme: openapi validate "oas-examples-repo/3.1/json/petstore.json" + - name: Run `openapi:validate` on an invalid file + uses: ./rdme-repo/ + id: openapi-validate-fail + continue-on-error: true + with: + rdme: openapi:validate rdme-repo/__tests__/__fixtures__/invalid-oas.json + + - name: Assert that previous validation step failed + if: ${{ steps.openapi-validate-fail.outcome == 'failure' }} + run: echo "The validation in the previous step failed as expected." + + - name: Throw error if previous validation step did not fail + if: ${{ steps.openapi-validate-fail.outcome == 'success' }} + run: echo "::error::Expected validation in previous step to fail" && exit 1 + # Docs: https://rdme-test.readme.io - name: Run `openapi` command uses: ./rdme-repo/ diff --git a/bin/set-major-version-tag.js b/bin/set-major-version-tag.js index ada20ac69..2b42e331c 100755 --- a/bin/set-major-version-tag.js +++ b/bin/set-major-version-tag.js @@ -37,6 +37,19 @@ async function runGitCmd(args) { */ async function setMajorVersionTag() { try { + console.log( + 'kanad test', + JSON.stringify({ + GITHUB_BASE_REF: process.env.GITHUB_BASE_REF, + GITHUB_HEAD_REF: process.env.GITHUB_HEAD_REF, + GITHUB_REF: process.env.GITHUB_REF, + GITHUB_REF_NAME: process.env.GITHUB_REF_NAME, + GITHUB_REF_PROTECTED: process.env.GITHUB_REF_PROTECTED, + GITHUB_REF_TYPE: process.env.GITHUB_REF_TYPE, + GITHUB_WORKFLOW_REF: process.env.GITHUB_WORKFLOW_REF, + }), + ); + const parsedVersion = parse(pkg.version); if (!parsedVersion) {