You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Remove artifacts
v1.2.0
Status and support
- ✔ stable
- ✔ supported
- ✖ no ongoing development
GitHub Action Artifacts are removed after 90 days. This cannot be configured either globally or per project. There's also a limit on free artifact space after which it becomes a payed resource. There's no configurable storage limit per project either, so some projects might use up all quota and not leave room for others.
We created this Action to solve these problems. It
- removes artifacts that are older than the specified age
- has the option to keep release (tagged) artifacts
- respects GitHub's rate limit
Add the following workflow to your repository and configure options.
.github/workflows/remove-old-artifacts.yml
name: Remove old artifacts
on:
schedule:
# Every day at 1am
- cron: '0 1 * * *'
jobs:
remove-old-artifacts:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Remove old artifacts
uses: c-hive/gha-remove-artifacts@v1
with:
age: '1 month'
# Optional inputs
# skip-tags: true
# skip-recent: 5
This project follows C-Hive guides for code style, way of working and other development concerns.
The project is available as open source under the terms of the MIT License.