Skip to content

Commit

Permalink
docs: Fix version detect in website (#5003)
Browse files Browse the repository at this point in the history
* docs: Fix version detect in website

* Update docusaurus.config.js
  • Loading branch information
Xuanwo authored Aug 13, 2024
1 parent eb7d430 commit e15d314
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,13 @@ const config = {
version: (function () {
if (websiteStaging && process.env.GITHUB_REF_TYPE === 'tag') {
const refName = process.env.GITHUB_REF_NAME;
const version = semver.parse(refName, {}, true);
return `${version.major}.${version.minor}.${version.patch}`;
if (refName.startsWith("v")) {
const version = semver.parse(refName, {}, true);
return `${version.major}.${version.minor}.${version.patch}`;
}
}

const refName = exec("git describe --tags --abbrev=0 --exclude '*rc*'").toString();
const refName = exec("git describe --tags --abbrev=0 --match 'v*'").toString();
const version = semver.parse(refName, {}, true);
return `${version.major}.${version.minor}.${version.patch}`;
})()
Expand Down

0 comments on commit e15d314

Please # to comment.