From 373afc327ee8d071108a6d8c2d090360481874e7 Mon Sep 17 00:00:00 2001 From: Son Chau Date: Thu, 23 Nov 2023 15:25:41 -0800 Subject: [PATCH] Update update-schema.yaml --- .github/workflows/update-schema.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/update-schema.yaml b/.github/workflows/update-schema.yaml index 38fe45532..84aed1003 100644 --- a/.github/workflows/update-schema.yaml +++ b/.github/workflows/update-schema.yaml @@ -92,14 +92,11 @@ jobs: // Update description to include sha of let schemaLines = schemaJson.split('\n'); for (let i = 0; i < 10; ++i) { - console.log('Original schemaLines:', schemaLines[i].trim()); let descStr = '"description": "This is the RESTful API for the MoH Service."'; - let textLink = ' Based on https://raw.githubusercontent.com/' + context.repo.owner + '/' + context.repo.repo + '/' + repoSha + '/' + repoPath + 'schema.json'; + let textLink = 'Based on https://raw.githubusercontent.com/' + context.repo.owner + '/' + context.repo.repo + '/' + repoSha + '/' + repoPath + 'schema.json'; if (descStr === schemaLines[i].trim()) { - - //schemaLines[i] += ' Based on https://raw.githubusercontent.com/' + context.repo.owner + '/' + context.repo.repo + '/' + repoSha + '/' + repoPath + 'schema.json'; - schemaLines[i] = schemaLines[i].replace(/("description": "This is the RESTful API for the MoH Service.")/, `$1 ${textLink}`); - console.log('REPLACE ME: ', schemaLines[i]); + schemaLines[i] = `"description": "This is the RESTful API for the MoH Service. ${textLink}"`; + } } schemaJson = schemaLines.join('\n');