File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed
Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change 1616 script : |
1717 const KEEP = 0;
1818 const workflowNames = ["VirusTotal Scan", "Cleanup old workflow runs"];
19- const currentWorkflowName = context.workflow;
2019
2120 // Get workflow ID
2221 const workflows = await github.rest.actions.listRepoWorkflows({
3130 continue;
3231 }
3332
34- if (wf.name === currentWorkflowName) {
35- core.info(`Skipping current workflow "${wf.name}"`);
36- continue;
37- }
38-
3933 // List runs
4034 const runs = await github.rest.actions.listWorkflowRuns({
4135 owner: context.repo.owner,
@@ -48,11 +42,15 @@ jobs:
4842 core.info(`Deleting ${toDelete.length} old runs`);
4943
5044 for (const run of toDelete) {
51- await github.rest.actions.deleteWorkflowRun({
52- owner: context.repo.owner,
53- repo: context.repo.repo,
54- run_id: run.id
55- });
45+ try {
46+ await github.rest.actions.deleteWorkflowRun({
47+ owner: context.repo.owner,
48+ repo: context.repo.repo,
49+ run_id: run.id
50+ });
51+ } catch (e) {
52+ core.info(`Skip run ${run.id}: ${e.message}`);
53+ }
5654 }
5755 }
5856
You can’t perform that action at this time.
0 commit comments