Skip to content

Cleanup

Cleanup #226

Workflow file for this run

name: Cleanup
on:
workflow_run:
workflows:
- SYCL Pre Commit
- SYCL Nightly
- SYCL Post Commit
types: [completed]
jobs:
cleanup:
runs-on: ubuntu-20.04
steps:
- uses: actions/github-script@v6
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifacts = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name.match(/^sycl_(linux|windows)_/);
});
matchArtifacts.forEach(async (artifact) => {
await github.rest.actions.deleteArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: artifact.id
});
});