Skip to content

Commit 6d3b95a

Browse files
author
Alexander Batashev
authored
[CI] Cleanup artifacts (#5726)
1 parent abcc848 commit 6d3b95a

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/sycl_cleanup.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Cleanup
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- SYCL
7+
- SYCL Nightly Builds
8+
- SYCL Post Commit
9+
types: [completed]
10+
11+
jobs:
12+
cleanup:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/github-script@v6
16+
with:
17+
script: |
18+
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
19+
owner: context.repo.owner,
20+
repo: context.repo.repo,
21+
run_id: context.payload.workflow_run.id,
22+
});
23+
let matchArtifacts = allArtifacts.data.artifacts.filter((artifact) => {
24+
return artifact.name.startsWith("sycl_linux_");
25+
});
26+
matchArtifacts.forEach(async (artifact) => {
27+
await github.rest.actions.deleteArtifact({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
artifact_id: artifact.id
31+
});
32+
});

0 commit comments

Comments
 (0)