-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automate the correction of website #298
Conversation
@@ -34,3 +54,62 @@ async function hasChangeLog(version) { | |||
rl.once('close', () => resolve(false)); | |||
}); | |||
} | |||
|
|||
async function checkExampleSdkVersion(version, file) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To use this function in isCorrectReadmeVersion
, We can change this function as follows:
function isSdkVersionURLCorrect(version, filepath) {
const data = fs.readFileSync(filepath, "utf8");
const matches = data.matchAll(/cdn\.webrtc\.ecl\.ntt\.com\/skyway-([0-9]+\.[0-9]+\.[0-9]+)(\.min)?\.js/g);
for (const match of matches) {
if (match[1] !== version) {
return false;
}
}
return true;
}
isSdkVersionURLCorrect("4.2.0", "README.md");
echo "Website is up to date. Skip updating website." | ||
exit 0 | ||
fi | ||
sed -i -e "s/[0-9]\.[0-9]\.[0-9]/${version}/g" skyway-official-web-site/docs/documents/javascript-sdk.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to narrow down the scope of regular expressions a bit.
exit 0 | ||
fi | ||
sed -i -e "s/[0-9]\.[0-9]\.[0-9]/${version}/g" skyway-official-web-site/docs/documents/javascript-sdk.md | ||
sed -i -e "s/[0-9]\.[0-9]\.[0-9]/${version}/g" skyway-official-web-site/docs/en/documents/javascript-sdk.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, when there are two digits, as in 1.4.41, they are not replaced.
Please check the type of change your PR introduces
Summary
Supplement
The SSH Key is set in the project of circleCI.
Check point