mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Improve whitespace handling
This commit is contained in:
16
lib/entry-points.js
generated
16
lib/entry-points.js
generated
@@ -151452,21 +151452,25 @@ function parseRemoteFileAddress(env, configFile) {
|
||||
"^((?<owner>[^/]+)/)?(?<repo>[^/@]+)(/(?<path>[^@]+))?(@(?<ref>.*))?$"
|
||||
);
|
||||
const pieces = format.exec(configFile.trim());
|
||||
if (!pieces?.groups?.repo || pieces.groups.repo.trim().length === 0) {
|
||||
const repo = pieces?.groups?.repo?.trim();
|
||||
if (!pieces?.groups || !repo || repo.length === 0) {
|
||||
throw new ConfigurationError(
|
||||
getConfigFileRepoFormatInvalidMessage(configFile)
|
||||
);
|
||||
}
|
||||
if (pieces.groups.path?.startsWith("/")) {
|
||||
const owner = pieces.groups.owner?.trim();
|
||||
const path29 = pieces.groups.path?.trim();
|
||||
const ref = pieces.groups.ref?.trim();
|
||||
if (path29?.startsWith("/")) {
|
||||
throw new ConfigurationError(
|
||||
`The path component of '${configFile}' cannot be an absolute path.`
|
||||
);
|
||||
}
|
||||
return {
|
||||
owner: pieces.groups.owner || getDefaultOwner(env),
|
||||
repo: pieces.groups.repo.trim(),
|
||||
path: pieces.groups.path || DEFAULT_CONFIG_FILE_NAME,
|
||||
ref: pieces.groups.ref || DEFAULT_CONFIG_FILE_REF
|
||||
owner: owner || getDefaultOwner(env),
|
||||
repo,
|
||||
path: path29 || DEFAULT_CONFIG_FILE_NAME,
|
||||
ref: ref || DEFAULT_CONFIG_FILE_REF
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user