mirror of
https://github.com/github/codeql-action.git
synced 2026-01-07 15:10:07 +08:00
improve regex
This commit is contained in:
@@ -57,7 +57,7 @@ test('parse codeql bundle url version', t => {
|
||||
|
||||
try {
|
||||
const parsedVersion = setupTools.getCodeQLURLVersion(url);
|
||||
t.assert(parsedVersion, expectedVersion);
|
||||
t.deepEqual(parsedVersion, expectedVersion);
|
||||
} catch (e) {
|
||||
t.fail(e.message);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export async function setupCodeQL(): Promise<CodeQLSetup> {
|
||||
|
||||
export function getCodeQLURLVersion(url: string): string {
|
||||
|
||||
const match = url.match(/codeql-bundle-([\d+(\.\d+)]+)/);
|
||||
const match = url.match(/\/codeql-bundle-(.*)\//);
|
||||
if (match === null || match.length < 2) {
|
||||
throw new Error(`Malformed tools url: ${url}. Version could not be inferred`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user