mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 17:41:28 +00:00
Make path optional in parseRemoteFileAddress
This commit is contained in:
7
lib/entry-points.js
generated
7
lib/entry-points.js
generated
@@ -151429,13 +151429,14 @@ function parseUserConfig(logger, pathInput, contents, validateConfig) {
|
||||
}
|
||||
|
||||
// src/config/remote-file.ts
|
||||
var DEFAULT_CONFIG_FILE_NAME = ".github/codeql-action.yaml";
|
||||
var DEFAULT_CONFIG_FILE_REF = "main";
|
||||
function parseRemoteFileAddress(configFile) {
|
||||
const format = new RegExp(
|
||||
"(?<owner>[^/]+)/(?<repo>[^/]+)/(?<path>[^@]+)(@(?<ref>.*))?"
|
||||
"(?<owner>[^/]+)/(?<repo>[^/@]+)(/(?<path>[^@]+))?(@(?<ref>.*))?"
|
||||
);
|
||||
const pieces = format.exec(configFile);
|
||||
if (!pieces?.groups?.owner || !pieces?.groups?.repo || !pieces?.groups?.path) {
|
||||
if (!pieces?.groups?.owner || !pieces?.groups?.repo) {
|
||||
throw new ConfigurationError(
|
||||
getConfigFileRepoFormatInvalidMessage(configFile)
|
||||
);
|
||||
@@ -151443,7 +151444,7 @@ function parseRemoteFileAddress(configFile) {
|
||||
return {
|
||||
owner: pieces.groups.owner,
|
||||
repo: pieces.groups.repo,
|
||||
path: pieces.groups.path,
|
||||
path: pieces.groups.path || DEFAULT_CONFIG_FILE_NAME,
|
||||
ref: pieces.groups.ref || DEFAULT_CONFIG_FILE_REF
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user