Skip to content

Commit 947d5e0

Browse files
committed
cleanup workflow: fix skip current workflow
1 parent 4e40e18 commit 947d5e0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/cleanup.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ jobs:
1414
- uses: actions/github-script@v7
1515
with:
1616
script: |
17-
const KEEP = 1;
17+
const KEEP = 0;
1818
const workflowNames = ["VirusTotal Scan", "Cleanup old workflow runs"];
19+
const currentWorkflowName = context.workflow;
1920
2021
// Get workflow ID
2122
const workflows = await github.rest.actions.listRepoWorkflows({
@@ -30,6 +31,11 @@ jobs:
3031
continue;
3132
}
3233
34+
if (wf.name === currentWorkflowName) {
35+
core.info(`Skipping current workflow "${wf.name}"`);
36+
continue;
37+
}
38+
3339
// List runs
3440
const runs = await github.rest.actions.listWorkflowRuns({
3541
owner: context.repo.owner,

0 commit comments

Comments
 (0)