You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-08 21:42:24 +03:00
Improve regex to ignore trailing -dirty and for rc tags
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -35,10 +35,10 @@ import AccessibleButton from '../views/elements/AccessibleButton';
|
|||||||
const REACT_SDK_VERSION = 'dist' in packageJson ? packageJson.version : packageJson.gitHead || '<local>';
|
const REACT_SDK_VERSION = 'dist' in packageJson ? packageJson.version : packageJson.gitHead || '<local>';
|
||||||
|
|
||||||
// Simple method to help prettify GH Release Tags and Commit Hashes.
|
// Simple method to help prettify GH Release Tags and Commit Hashes.
|
||||||
const semVerRegex = /^v?(\d+\.\d+\.\d+)(?:-(?:\d+-g)?(.+))?|$/i;
|
const semVerRegex = /^v?(\d+\.\d+\.\d+(?:-rc.+)?)(?:-(?:\d+-g)?([0-9a-fA-F]+))?(?:-dirty)?$/i;
|
||||||
const gHVersionLabel = function(repo, token) {
|
const gHVersionLabel = function(repo, token) {
|
||||||
const match = token.match(semVerRegex);
|
const match = token.match(semVerRegex);
|
||||||
let url; // assume commit hash
|
let url;
|
||||||
if (match && match[1]) { // basic semVer string possibly with commit hash
|
if (match && match[1]) { // basic semVer string possibly with commit hash
|
||||||
url = (match.length > 1 && match[2])
|
url = (match.length > 1 && match[2])
|
||||||
? `https://github.com/${repo}/commit/${match[2]}`
|
? `https://github.com/${repo}/commit/${match[2]}`
|
||||||
|
|||||||
Reference in New Issue
Block a user