One more easy and straightforward way to remove Actions' cache - Purge cache GH Action.
This action allows the cache of GitHub Actions to be automatically purged based on the last usage and configured TTL (default - 7 days).
Example:
name: Clear Cacheon: schedule: - cron: '0 0 * * *' # Runs once a day (https://crontab.guru/once-a-day)jobs: clear: name: Clear cache runs-on: ubuntu-latest steps: - uses: MyAlbum/purge-cache@v1 with: max-age: 604800 # Cache max 7 days since last use (this is the default)
The workflow above will run once a day and remove all the cache that was last used more than 7 days ago.