mirror of
https://github.com/github/codeql-action.git
synced 2026-10-03 09:14:58 +00:00
Improve pattern matching and error handling
This commit is contained in:
@@ -87,7 +87,12 @@ const entryPointsPlugin = {
|
||||
build.onStart(() => {
|
||||
const actionFiles = globSync("src/*-action{,-post}.ts");
|
||||
for (const actionFile of actionFiles) {
|
||||
const match = actionFile.match(/src\/(.*)-action(-post)?.ts/);
|
||||
const match = basename(actionFile).match(/(.*)-action(-post)?/);
|
||||
|
||||
if (match.length < 2) {
|
||||
throw new Error(`'${actionFile}' didn't match expected pattern.`);
|
||||
}
|
||||
|
||||
const actionName = match[1];
|
||||
const isPost = match[2] !== undefined;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user