27 lines
753 B
YAML
27 lines
753 B
YAML
name: Delete old artifacts mannually
|
|
# Run action manually
|
|
on: [workflow_dispatch]
|
|
|
|
jobs:
|
|
delete:
|
|
name: Delete Old Artifacts
|
|
runs-on: ubuntu-latest-selfhost
|
|
steps:
|
|
- uses: actions/github-script@v6
|
|
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,
|
|
})
|
|
})
|