fome-fw/.github/workflows/delete-all-artifacts.yaml

27 lines
753 B
YAML
Raw Normal View History

2023-02-22 21:04:08 -08:00
name: Delete old artifacts mannually
# Run action manually
on: [workflow_dispatch]
jobs:
delete:
name: Delete Old Artifacts
2023-02-22 21:07:41 -08:00
runs-on: ubuntu-latest-selfhost
2023-02-22 21:04:08 -08:00
steps:
- uses: actions/github-script@v7
2023-02-22 21:04:08 -08:00
id: artifact
with:
# Delete all artifacts
script: |
const res = await github.rest.actions.listArtifactsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
})
res.data.artifacts
.forEach(({ id }) => {
github.rest.actions.deleteArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: id,
})
})