Skip to content

Cache Cleanup Action

Actions
Removes unused GitHub Actions caches based on PR status and age
v1.0.0
Latest
Star (0)

GitHub Actions Cache Cleanup

GitHub Action for automatic cleanup of unused GitHub Actions caches. Removes caches from closed pull requests and caches from the main branch that haven't been accessed for a configurable time period. Helps reduce storage usage and improve build performance by keeping the cache environment clean.

What it does

  • Deletes caches from closed Pull Requests
  • Deletes caches from the main branch that haven't been used for X days (default: 7)

Sample run

image

How to use

Create a workflow file in your repository (e.g. .github/workflows/cleanup-cache.yml):

name: Expire caches
on:
  schedule:
    # Run every Monday at 00:00
    - cron: '0 0 * * 1'
  workflow_dispatch:
    # Allows for manual workflow runs
permissions:
  actions: write
  pull-requests: read
jobs:
  cleanup:
    runs-on: ubuntu-latest
    
    steps:
      - name: Delete unused caches
        uses: FrankBurmo/cache-cleanup-action@v1.0.0
        with:
          # Optional: Change number of days before main branch caches are deleted (default: 7)
          main-branch-retention-days: '14'

Cache Cleanup Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Removes unused GitHub Actions caches based on PR status and age
v1.0.0
Latest

Cache Cleanup Action is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.