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 130713b commit aadba5b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/update-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ jobs:
let schemaLines = schemaJson.split('\n');
for (let i = 0; i < 10; ++i) {
console.log('Original schemaLines:', schemaLines[i]);
if ("description: This is the RESTful API for the MoH Service." === schemaLines[i].trim()) {
schemaLines[i] += ' Based on https://raw.githubusercontent.com/' + context.repo.owner + '/' + context.repo.repo + '/' + repoSha + '/' + repoPath + 'schema.json';
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';
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}`);
}
}
schemaJson = schemaLines.join('\n');
Expand Down

0 comments on commit aadba5b

Please sign in to comment.