Skip to content

Commit

Permalink
Update update-schema.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
SonQBChau committed Nov 23, 2023
1 parent 6ae3d23 commit 373afc3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/update-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 373afc3

Please sign in to comment.