Skip to content

Commit 4c8ecf8

Browse files
Partially revert "[CI] Remove artifacts cleanup task (#10230)" (#10285)
This restores sycl_cleanup action that had been removed in commit ece35ad.
1 parent 7f12b28 commit 4c8ecf8

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 Pre Commit
7+
- SYCL Nightly
8+
- SYCL Post Commit
9+
types: [completed]
10+
11+
jobs:
12+
cleanup:
13+
runs-on: ubuntu-20.04
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.match(/^sycl_(linux|windows)_/);
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)