Skip to content

Commit 994c355

Browse files
committed
Stop processing after Action download lines
1 parent d50c540 commit 994c355

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

audit_workflow_runs.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ function searchForActionsLines(entry, actionRegex) {
1313
const logContent = entry.getData().toString("utf8"); // Extract file content as a string
1414
const logLines = logContent.split("\n");
1515
const actions = [];
16+
let foundActions = false;
1617

1718
for (const line of logLines) {
1819
const data = line.split(" ").slice(1).join(" ");
1920
if (data == undefined) {
2021
continue;
2122
}
2223
if (data.startsWith("Download action repository '")) {
24+
foundActions = true;
2325
const match = actionRegex.exec(data);
2426
if (match) {
2527
const action = match[1];
@@ -28,6 +30,9 @@ function searchForActionsLines(entry, actionRegex) {
2830
const [repo, version] = action.split("@");
2931
actions.push([repo, version, sha]);
3032
}
33+
// quit processing the log after the first line that is not an action, if we already found actions
34+
} else if (foundActions) {
35+
break;
3136
}
3237
}
3338

0 commit comments

Comments
 (0)