Skip to content

voplica/cache-clean-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Self-Hosted Runner Cache Clean Action

This build action allows to trigger clean for self-hosted cache used by self-hosted GitHub runners. It triggers cache clean-up for a branch which was deleted, archived, or for which any of the PRs were closed.

Parameters:

  • dispatch_token (Required, string) - Token used for a workflow dispatch. Should be $GH_BUILDS_WORKFLOW_DISPATCH_TOKEN.
  • gh_hosted_token (string) - Token for GitHub hosted Cache to clean up. Should be: $GITHUB_TOKEN. If not present then GitHub hosted cache cleanup is skipped and only self-hosted cache will be cleaned up. Ensure proper permissions are set for the workflow.

Example:

name: Cleanup Branch Cache
permissions:
  contents: write
  actions: write
  pull-requests: write
on:
  pull_request:
    types:
      - closed
  delete:
    branches:
      - '*'
  repository_dispatch:
    types:
      - branch_archived

jobs:
  build:
    runs-on: "ubuntu-latest"
    steps:
      - name: Trigger cache cleanup for a branch
        uses: voplica/[email protected]
        with:
          dispatch_token: "${{ secrets.GH_BUILDS_WORKFLOW_DISPATCH_TOKEN }}"
          gh_hosted_token: "${{ secrets.GITHUB_TOKEN }}"
© 2025 Voplica LLC