From befa85fe710cbf13c2ecc431347fa16762d04c7b Mon Sep 17 00:00:00 2001 From: Tiffany Qi Date: Fri, 26 Sep 2025 17:12:45 -0700 Subject: [PATCH 01/13] modify workflows --- .github/workflows/rdme-openapi.yml | 6 +++++- .github/workflows/rdme-staging.yml | 17 +++++++++-------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rdme-openapi.yml b/.github/workflows/rdme-openapi.yml index 8c5a22d404..e56dd04113 100644 --- a/.github/workflows/rdme-openapi.yml +++ b/.github/workflows/rdme-openapi.yml @@ -3,6 +3,10 @@ name: Publish OpenAPI specs to ReadMe on: push: branches: [ main ] + paths: + - 'openapi/**' + - '.github/actions/**' + - '.github/workflows/rdme-openapi.yml' jobs: rdme-openapi: @@ -17,4 +21,4 @@ jobs: - run: npm run api:publish env: README_API_KEY: ${{ secrets.README_API_KEY }} - README_VERSION: '3.26' + README_VERSION: '3.27' diff --git a/.github/workflows/rdme-staging.yml b/.github/workflows/rdme-staging.yml index de8c8a51f8..4326af65ed 100644 --- a/.github/workflows/rdme-staging.yml +++ b/.github/workflows/rdme-staging.yml @@ -1,13 +1,14 @@ name: Generate ReadMe Staging 🦉 -on: - # run this workflow on all PRs that have reference dirs changed - pull_request: - paths: - - 'openapi/**' - - 'reference/**' - - '.github/actions/**' - - '.github/workflows/rdme-staging.yml' +# This is currently broken, fix this in a future PR +# on: +# # run this workflow on all PRs that have reference dirs changed +# pull_request: +# paths: +# - 'openapi/**' +# - 'reference/**' +# - '.github/actions/**' +# - '.github/workflows/rdme-staging.yml' jobs: # //////////////////////////////////////////////////////////////////////// From 24f49e72ce25d194a64f0a6666bc8420bf93ea28 Mon Sep 17 00:00:00 2001 From: Tiffany Qi Date: Fri, 26 Sep 2025 17:31:24 -0700 Subject: [PATCH 02/13] update publish script --- openapi/publish.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/openapi/publish.js b/openapi/publish.js index 675d09c7cc..0ac3db0f0d 100644 --- a/openapi/publish.js +++ b/openapi/publish.js @@ -31,13 +31,10 @@ async function execAndLog(cmd, args) { async function updateSpecs() { // fetch IDs of openapi specs via readme API const res = await fetch( - `https://dash.readme.com/api/v1/api-specification?perPage=10&page=1`, + `https://api.readme.com/v2/branches/${README_VERSION}/apis`, { headers: { - Authorization: `Basic ${Buffer.from(README_API_KEY).toString( - "base64" - )}`, - "x-readme-version": README_VERSION, + Authorization: `Bearer ${README_API_KEY}`, }, } ); @@ -54,18 +51,20 @@ async function updateSpecs() { const fullPath = path.join(outBase, specFile); const yamlStr = fs.readFileSync(fullPath, "utf8"); const spec = YAML.parse(yamlStr); - const specMeta = remoteSpecMetas.find((m) => m.title === spec.info.title); + const slug = specFile.split(`.openapi.yaml`)[0]; + const specMeta = remoteSpecMetas.data.find((m) => m.filename.split(`.json`)[0] === slug); if (!specMeta) { console.log(`!!! No spec found for "${spec.info.title}". Please upload it as found in the developer.mixpanel.com runbook.`); continue; } - const specId = specMeta.id; // validate and publish spec - console.log(`Updating ${spec.info.title} (${specFile}, ID ${specId})`); + console.log(`Updating ${spec.info.title} (${specFile}`); await execAndLog('npx', ['rdme', 'openapi:validate', fullPath]); + // when readme was upgraded to readme refactored, all of the yaml files were converted to json, and therefore + // the slug name also looks like "annotations-api.json", even though we store them as yaml here. await execAndLog( - 'npx', ['rdme', 'openapi', fullPath, `--id=${specId}`, `--key=${README_API_KEY}`] + 'npx', ['rdme', 'openapi', 'upload', fullPath, `--key=${README_API_KEY}`, `--slug=${slug}.json`] ); } } From 63627a9ef661f5e7e4fb317be1f5a02e99a498d7 Mon Sep 17 00:00:00 2001 From: Tiffany Qi Date: Mon, 29 Sep 2025 17:37:47 -0700 Subject: [PATCH 03/13] update to use json versions and rename outputs --- openapi/openapi.config.yaml | 20 ++++++++++---------- openapi/publish.js | 14 ++++++++------ 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/openapi/openapi.config.yaml b/openapi/openapi.config.yaml index a2e3d7d45a..d81f1ef923 100644 --- a/openapi/openapi.config.yaml +++ b/openapi/openapi.config.yaml @@ -1,34 +1,34 @@ apis: annotations: root: ./src/annotations.openapi.yaml - output: ./out/annotations.openapi.yaml + output: ./out/annotations-api.json data-pipelines: root: ./src/data-pipelines.openapi.yaml - output: ./out/data-pipelines.openapi.yaml + output: ./out/data-pipelines-api.json export: root: ./src/export.openapi.yaml - output: ./out/export.openapi.yaml + output: ./out/event-export-api.json gdpr: root: ./src/gdpr.openapi.yaml - output: ./out/gdpr.openapi.yaml + output: ./out/gdpr-api-2.json identity: root: ./src/identity.openapi.yaml - output: ./out/identity.openapi.yaml + output: ./out/identity-api.json ingestion: root: ./src/ingestion.openapi.yaml - output: ./out/ingestion.openapi.yaml + output: ./out/ingestion-api.json lexicon-schemas: root: ./src/lexicon-schemas.openapi.yaml - output: ./out/lexicon-schemas.openapi.yaml + output: ./out/lexicon-schemas-api.json query: root: ./src/query.openapi.yaml - output: ./out/query.openapi.yaml + output: ./out/query-api.json service-accounts: root: ./src/service-accounts.openapi.yaml - output: ./out/service-accounts.openapi.yaml + output: ./out/service-accounts-api.json warehouse-connectors: root: ./src/warehouse-connectors.openapi.yaml - output: ./out/warehouse-connectors.openapi.yaml + output: ./out/warehouse-connectors-api.json extends: - recommended diff --git a/openapi/publish.js b/openapi/publish.js index 0ac3db0f0d..525f53d918 100644 --- a/openapi/publish.js +++ b/openapi/publish.js @@ -44,15 +44,19 @@ async function updateSpecs() { const outBase = path.resolve(__dirname, `out`); const filenames = fs .readdirSync(outBase) - .filter((fn) => fn.endsWith(`.openapi.yaml`)); + .filter((fn) => fn.endsWith(`.json`)); + + if (!remoteSpecMetas) { + console.error(`!!! No remote specs found, please double check the API`); + process.exit(1); + } for (specFile of filenames) { // get ID of each spec by matching title between filename and metadata const fullPath = path.join(outBase, specFile); const yamlStr = fs.readFileSync(fullPath, "utf8"); const spec = YAML.parse(yamlStr); - const slug = specFile.split(`.openapi.yaml`)[0]; - const specMeta = remoteSpecMetas.data.find((m) => m.filename.split(`.json`)[0] === slug); + const specMeta = remoteSpecMetas.data.find((m) => m.filename === specFile); if (!specMeta) { console.log(`!!! No spec found for "${spec.info.title}". Please upload it as found in the developer.mixpanel.com runbook.`); continue; @@ -61,10 +65,8 @@ async function updateSpecs() { // validate and publish spec console.log(`Updating ${spec.info.title} (${specFile}`); await execAndLog('npx', ['rdme', 'openapi:validate', fullPath]); - // when readme was upgraded to readme refactored, all of the yaml files were converted to json, and therefore - // the slug name also looks like "annotations-api.json", even though we store them as yaml here. await execAndLog( - 'npx', ['rdme', 'openapi', 'upload', fullPath, `--key=${README_API_KEY}`, `--slug=${slug}.json`] + 'npx', ['rdme', 'openapi', 'upload', fullPath, `--key=${README_API_KEY}`, `--slug=${specFile}`, `--confirm-overwrite`] ); } } From f75eb505f38972a2fccbbb51821d5ec0faddbe3a Mon Sep 17 00:00:00 2001 From: Tiffany Qi Date: Mon, 29 Sep 2025 17:42:19 -0700 Subject: [PATCH 04/13] modify test file --- openapi/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/test.sh b/openapi/test.sh index 913e715776..d3762e99df 100755 --- a/openapi/test.sh +++ b/openapi/test.sh @@ -4,7 +4,7 @@ set -e npm run api:lint npm run api:build -for file in openapi/out/*.yaml; do +for file in openapi/out/*.json; do echo "✔ Validating $file" npx rdme openapi:validate $file done From d49e56e9e786a10bd7d22e176efd44a215c32d94 Mon Sep 17 00:00:00 2001 From: Tiffany Qi Date: Mon, 29 Sep 2025 17:48:34 -0700 Subject: [PATCH 05/13] testing --- .github/workflows/rdme-openapi.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/rdme-openapi.yml b/.github/workflows/rdme-openapi.yml index e56dd04113..28c309eeb3 100644 --- a/.github/workflows/rdme-openapi.yml +++ b/.github/workflows/rdme-openapi.yml @@ -2,7 +2,6 @@ name: Publish OpenAPI specs to ReadMe on: push: - branches: [ main ] paths: - 'openapi/**' - '.github/actions/**' From 2a3ff4792b76cf0d3904662000f79362962edb11 Mon Sep 17 00:00:00 2001 From: Tiffany Qi Date: Mon, 29 Sep 2025 18:15:39 -0700 Subject: [PATCH 06/13] add debugger --- openapi/publish.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openapi/publish.js b/openapi/publish.js index 525f53d918..c8056fcf56 100644 --- a/openapi/publish.js +++ b/openapi/publish.js @@ -4,6 +4,7 @@ const process = require("node:process"); const util = require("node:util"); const YAML = require("yaml"); +const env = { ...process.env, DEBUG: "rdme*" }; const execFile = util.promisify(require("node:child_process").execFile); const README_API_KEY = process.env.README_API_KEY; @@ -66,7 +67,7 @@ async function updateSpecs() { console.log(`Updating ${spec.info.title} (${specFile}`); await execAndLog('npx', ['rdme', 'openapi:validate', fullPath]); await execAndLog( - 'npx', ['rdme', 'openapi', 'upload', fullPath, `--key=${README_API_KEY}`, `--slug=${specFile}`, `--confirm-overwrite`] + 'npx', ['rdme', 'openapi', 'upload', fullPath, `--key=${README_API_KEY}`, `--slug=${specFile}`, `--confirm-overwrite`], {env} ); } } From 76114ae15095bf177ebe84cf1895e4bef3825eff Mon Sep 17 00:00:00 2001 From: Tiffany Qi Date: Mon, 29 Sep 2025 18:34:53 -0700 Subject: [PATCH 07/13] try without confirm overrite --- openapi/publish.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/publish.js b/openapi/publish.js index c8056fcf56..9998ca203d 100644 --- a/openapi/publish.js +++ b/openapi/publish.js @@ -67,7 +67,7 @@ async function updateSpecs() { console.log(`Updating ${spec.info.title} (${specFile}`); await execAndLog('npx', ['rdme', 'openapi:validate', fullPath]); await execAndLog( - 'npx', ['rdme', 'openapi', 'upload', fullPath, `--key=${README_API_KEY}`, `--slug=${specFile}`, `--confirm-overwrite`], {env} + 'npx', ['rdme', 'openapi', 'upload', fullPath, `--key=${README_API_KEY}`, `--slug=${specFile}`], {env} ); } } From 80f2b4ea21da6145e6f86dd12630db8b6232569d Mon Sep 17 00:00:00 2001 From: Tiffany Qi Date: Tue, 30 Sep 2025 13:50:44 -0700 Subject: [PATCH 08/13] try adding a convert step --- openapi/openapi.config.yaml | 20 ++++++++++---------- openapi/publish.js | 36 ++++++++++++++++++++++++++++++++---- 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/openapi/openapi.config.yaml b/openapi/openapi.config.yaml index d81f1ef923..7377dd0243 100644 --- a/openapi/openapi.config.yaml +++ b/openapi/openapi.config.yaml @@ -1,34 +1,34 @@ apis: annotations: root: ./src/annotations.openapi.yaml - output: ./out/annotations-api.json + output: ./out/annotations-api.yaml data-pipelines: root: ./src/data-pipelines.openapi.yaml - output: ./out/data-pipelines-api.json + output: ./out/data-pipelines-api.yaml export: root: ./src/export.openapi.yaml - output: ./out/event-export-api.json + output: ./out/event-export-api.yaml gdpr: root: ./src/gdpr.openapi.yaml - output: ./out/gdpr-api-2.json + output: ./out/gdpr-api-2.yaml identity: root: ./src/identity.openapi.yaml - output: ./out/identity-api.json + output: ./out/identity-api.yaml ingestion: root: ./src/ingestion.openapi.yaml - output: ./out/ingestion-api.json + output: ./out/ingestion-api.yaml lexicon-schemas: root: ./src/lexicon-schemas.openapi.yaml - output: ./out/lexicon-schemas-api.json + output: ./out/lexicon-schemas-api.yaml query: root: ./src/query.openapi.yaml - output: ./out/query-api.json + output: ./out/query-api.yaml service-accounts: root: ./src/service-accounts.openapi.yaml - output: ./out/service-accounts-api.json + output: ./out/service-accounts-api.yaml warehouse-connectors: root: ./src/warehouse-connectors.openapi.yaml - output: ./out/warehouse-connectors-api.json + output: ./out/warehouse-connectors-api.yaml extends: - recommended diff --git a/openapi/publish.js b/openapi/publish.js index 9998ca203d..601b387e9a 100644 --- a/openapi/publish.js +++ b/openapi/publish.js @@ -8,11 +8,11 @@ const env = { ...process.env, DEBUG: "rdme*" }; const execFile = util.promisify(require("node:child_process").execFile); const README_API_KEY = process.env.README_API_KEY; +const README_VERSION = process.env.README_VERSION; if (!README_API_KEY) { console.error(`README_API_KEY not set`); process.exit(1); } -const README_VERSION = process.env.README_VERSION; if (!README_VERSION) { console.error(`README_VERSION not set`); process.exit(1); @@ -29,6 +29,21 @@ async function execAndLog(cmd, args) { } } +function getSlugFromJson(file) { + const splitFile = file.split(`.json`); + return splitFile[0]; +} + +function getSlugFromYaml(file) { + const splitFile = file.split(`.yaml`); + return splitFile[0]; +} + +function convertSlugToJson(file) { + const slug = getSlugFromYaml(file); + return `${slug}.json`; +} + async function updateSpecs() { // fetch IDs of openapi specs via readme API const res = await fetch( @@ -45,7 +60,7 @@ async function updateSpecs() { const outBase = path.resolve(__dirname, `out`); const filenames = fs .readdirSync(outBase) - .filter((fn) => fn.endsWith(`.json`)); + .filter((fn) => fn.endsWith(`.yaml`)); if (!remoteSpecMetas) { console.error(`!!! No remote specs found, please double check the API`); @@ -57,7 +72,7 @@ async function updateSpecs() { const fullPath = path.join(outBase, specFile); const yamlStr = fs.readFileSync(fullPath, "utf8"); const spec = YAML.parse(yamlStr); - const specMeta = remoteSpecMetas.data.find((m) => m.filename === specFile); + const specMeta = remoteSpecMetas.data.find((m) => getSlugFromJson(m.filename) === getSlugFromYaml(specFile)); if (!specMeta) { console.log(`!!! No spec found for "${spec.info.title}". Please upload it as found in the developer.mixpanel.com runbook.`); continue; @@ -66,8 +81,21 @@ async function updateSpecs() { // validate and publish spec console.log(`Updating ${spec.info.title} (${specFile}`); await execAndLog('npx', ['rdme', 'openapi:validate', fullPath]); + // this converts the file to json, since it does this step directly in readme anyway + await execAndLog( + 'npx', ['rdme', 'openapi', 'convert', fullPath, `--out=openapi/out/${convertSlugToJson(specFile)}`], {env} + ); + // publish the json version await execAndLog( - 'npx', ['rdme', 'openapi', 'upload', fullPath, `--key=${README_API_KEY}`, `--slug=${specFile}`], {env} + 'npx', [ + 'rdme', + 'openapi', + 'upload', + `${convertSlugToJson(fullPath)}`, + `--key=${README_API_KEY}`, + `--slug=${convertSlugToJson(specFile)}`, + `--confirm-overwrite` + ], {env} ); } } From e1a19aac6cde7a367d32cb0403fbdb8b56fd1819 Mon Sep 17 00:00:00 2001 From: Tiffany Qi Date: Tue, 30 Sep 2025 13:58:59 -0700 Subject: [PATCH 09/13] use the full path instead for conversion --- openapi/publish.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi/publish.js b/openapi/publish.js index 601b387e9a..1d0bf68b23 100644 --- a/openapi/publish.js +++ b/openapi/publish.js @@ -83,7 +83,7 @@ async function updateSpecs() { await execAndLog('npx', ['rdme', 'openapi:validate', fullPath]); // this converts the file to json, since it does this step directly in readme anyway await execAndLog( - 'npx', ['rdme', 'openapi', 'convert', fullPath, `--out=openapi/out/${convertSlugToJson(specFile)}`], {env} + 'npx', ['rdme', 'openapi', 'convert', fullPath, `--out=${convertSlugToJson(fullPath)}`], {env} ); // publish the json version await execAndLog( From a29acba781a0a19c9a50ff21eb3df5d1db925fec Mon Sep 17 00:00:00 2001 From: Tiffany Qi Date: Tue, 30 Sep 2025 14:44:39 -0700 Subject: [PATCH 10/13] fix rdme version --- openapi/publish.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openapi/publish.js b/openapi/publish.js index 1d0bf68b23..0d99ecc652 100644 --- a/openapi/publish.js +++ b/openapi/publish.js @@ -80,15 +80,15 @@ async function updateSpecs() { // validate and publish spec console.log(`Updating ${spec.info.title} (${specFile}`); - await execAndLog('npx', ['rdme', 'openapi:validate', fullPath]); + await execAndLog('npx', ['rdme@10.5.1', 'openapi:validate', fullPath]); // this converts the file to json, since it does this step directly in readme anyway await execAndLog( - 'npx', ['rdme', 'openapi', 'convert', fullPath, `--out=${convertSlugToJson(fullPath)}`], {env} + 'npx', ['rdme@10.5.1', 'openapi', 'convert', fullPath, `--out=${convertSlugToJson(fullPath)}`], {env} ); // publish the json version await execAndLog( 'npx', [ - 'rdme', + 'rdme@10.5.1', 'openapi', 'upload', `${convertSlugToJson(fullPath)}`, From 35cfe185c748671306dbdbb06157a6e825f4e589 Mon Sep 17 00:00:00 2001 From: Tiffany Qi Date: Tue, 30 Sep 2025 15:01:09 -0700 Subject: [PATCH 11/13] remove conversion step --- openapi/openapi.config.yaml | 20 +++++++++---------- openapi/publish.js | 38 +++++-------------------------------- 2 files changed, 15 insertions(+), 43 deletions(-) diff --git a/openapi/openapi.config.yaml b/openapi/openapi.config.yaml index 7377dd0243..d81f1ef923 100644 --- a/openapi/openapi.config.yaml +++ b/openapi/openapi.config.yaml @@ -1,34 +1,34 @@ apis: annotations: root: ./src/annotations.openapi.yaml - output: ./out/annotations-api.yaml + output: ./out/annotations-api.json data-pipelines: root: ./src/data-pipelines.openapi.yaml - output: ./out/data-pipelines-api.yaml + output: ./out/data-pipelines-api.json export: root: ./src/export.openapi.yaml - output: ./out/event-export-api.yaml + output: ./out/event-export-api.json gdpr: root: ./src/gdpr.openapi.yaml - output: ./out/gdpr-api-2.yaml + output: ./out/gdpr-api-2.json identity: root: ./src/identity.openapi.yaml - output: ./out/identity-api.yaml + output: ./out/identity-api.json ingestion: root: ./src/ingestion.openapi.yaml - output: ./out/ingestion-api.yaml + output: ./out/ingestion-api.json lexicon-schemas: root: ./src/lexicon-schemas.openapi.yaml - output: ./out/lexicon-schemas-api.yaml + output: ./out/lexicon-schemas-api.json query: root: ./src/query.openapi.yaml - output: ./out/query-api.yaml + output: ./out/query-api.json service-accounts: root: ./src/service-accounts.openapi.yaml - output: ./out/service-accounts-api.yaml + output: ./out/service-accounts-api.json warehouse-connectors: root: ./src/warehouse-connectors.openapi.yaml - output: ./out/warehouse-connectors-api.yaml + output: ./out/warehouse-connectors-api.json extends: - recommended diff --git a/openapi/publish.js b/openapi/publish.js index 0d99ecc652..07307e2bde 100644 --- a/openapi/publish.js +++ b/openapi/publish.js @@ -4,7 +4,6 @@ const process = require("node:process"); const util = require("node:util"); const YAML = require("yaml"); -const env = { ...process.env, DEBUG: "rdme*" }; const execFile = util.promisify(require("node:child_process").execFile); const README_API_KEY = process.env.README_API_KEY; @@ -29,21 +28,6 @@ async function execAndLog(cmd, args) { } } -function getSlugFromJson(file) { - const splitFile = file.split(`.json`); - return splitFile[0]; -} - -function getSlugFromYaml(file) { - const splitFile = file.split(`.yaml`); - return splitFile[0]; -} - -function convertSlugToJson(file) { - const slug = getSlugFromYaml(file); - return `${slug}.json`; -} - async function updateSpecs() { // fetch IDs of openapi specs via readme API const res = await fetch( @@ -60,42 +44,30 @@ async function updateSpecs() { const outBase = path.resolve(__dirname, `out`); const filenames = fs .readdirSync(outBase) - .filter((fn) => fn.endsWith(`.yaml`)); + .filter((fn) => fn.endsWith(`.json`)); if (!remoteSpecMetas) { console.error(`!!! No remote specs found, please double check the API`); process.exit(1); } - for (specFile of filenames) { + for (specFile of [filenames[0]]) { // get ID of each spec by matching title between filename and metadata const fullPath = path.join(outBase, specFile); const yamlStr = fs.readFileSync(fullPath, "utf8"); const spec = YAML.parse(yamlStr); - const specMeta = remoteSpecMetas.data.find((m) => getSlugFromJson(m.filename) === getSlugFromYaml(specFile)); + const specMeta = remoteSpecMetas.data.find((m) => m.filename === specFile); if (!specMeta) { console.log(`!!! No spec found for "${spec.info.title}". Please upload it as found in the developer.mixpanel.com runbook.`); continue; } // validate and publish spec - console.log(`Updating ${spec.info.title} (${specFile}`); + console.log(`Updating ${spec.info.title} (${specFile})`); await execAndLog('npx', ['rdme@10.5.1', 'openapi:validate', fullPath]); - // this converts the file to json, since it does this step directly in readme anyway - await execAndLog( - 'npx', ['rdme@10.5.1', 'openapi', 'convert', fullPath, `--out=${convertSlugToJson(fullPath)}`], {env} - ); // publish the json version await execAndLog( - 'npx', [ - 'rdme@10.5.1', - 'openapi', - 'upload', - `${convertSlugToJson(fullPath)}`, - `--key=${README_API_KEY}`, - `--slug=${convertSlugToJson(specFile)}`, - `--confirm-overwrite` - ], {env} + 'npx', ['rdme@10.5.1', 'openapi', 'upload', `${fullPath}`, `--key=${README_API_KEY}`, `--slug=${specFile}`, `--confirm-overwrite`], ); } } From e2fb4c20ce00fa52aa3daecffa7d90a6e6f1f7f8 Mon Sep 17 00:00:00 2001 From: Tiffany Qi Date: Wed, 1 Oct 2025 11:46:54 -0700 Subject: [PATCH 12/13] add branch back in --- openapi/publish.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/openapi/publish.js b/openapi/publish.js index 07307e2bde..8f6773eda5 100644 --- a/openapi/publish.js +++ b/openapi/publish.js @@ -51,7 +51,7 @@ async function updateSpecs() { process.exit(1); } - for (specFile of [filenames[0]]) { + for (specFile of filenames) { // get ID of each spec by matching title between filename and metadata const fullPath = path.join(outBase, specFile); const yamlStr = fs.readFileSync(fullPath, "utf8"); @@ -67,7 +67,16 @@ async function updateSpecs() { await execAndLog('npx', ['rdme@10.5.1', 'openapi:validate', fullPath]); // publish the json version await execAndLog( - 'npx', ['rdme@10.5.1', 'openapi', 'upload', `${fullPath}`, `--key=${README_API_KEY}`, `--slug=${specFile}`, `--confirm-overwrite`], + 'npx', [ + 'rdme@10.5.1', + 'openapi', + 'upload', + `${fullPath}`, + `--key=${README_API_KEY}`, + `--slug=${specFile}`, + `--branch=${README_VERSION}`, + `--confirm-overwrite`, + ], ); } } From 5c1bc17986c80bfd92806949e0e926e76e045153 Mon Sep 17 00:00:00 2001 From: Tiffany Qi Date: Wed, 1 Oct 2025 14:55:00 -0700 Subject: [PATCH 13/13] bring back to main branch only --- .github/workflows/rdme-openapi.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rdme-openapi.yml b/.github/workflows/rdme-openapi.yml index 28c309eeb3..56058926b1 100644 --- a/.github/workflows/rdme-openapi.yml +++ b/.github/workflows/rdme-openapi.yml @@ -1,7 +1,8 @@ -name: Publish OpenAPI specs to ReadMe +name: Publish OpenAPI specs to ReadMe Production on: push: + branches: [ main ] paths: - 'openapi/**' - '.github/actions/**'