Skip to content

snnaplab/delete-branch-cache-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

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Delete Branch Cache Action

CI

Deletes GitHub Actions caches for a branch.

Besides if you want to clear the caches for some reason, you can save cache space by deleting the caches you no longer need immediately, because total size of all caches in a repository is limited to 10 GB.

Inputs

Name Description Default Required
repository Target repository name with owner, eg snnaplab/delete-branch-cache-action. Specify when deleting the cache of a repository different from the workflow. ${{ github.repository }} false
ref Git reference of target branch in refs/heads/<branch name> format. To reference a pull request use refs/pull/<number>/merge format. ${{ github.ref }} false
key Delete caches with keys that prefix match the key specified here. If not specified, all caches of the branch specified by ref will be deleted. false
github-token Specify a personal access token (PAT) when targeting a repository different from the workflow. ${{ github.token }} false

Example

Remove unused caches when closing a pull request

Caches created in the HEAD branch of a pull request are no longer used, so delete them immediately to save repository cache space.

name: Delete Unused Caches

on:
  pull_request:
    types: [closed]

jobs:
  delete:
    runs-on: ubuntu-latest
    steps:
      - uses: snnaplab/delete-branch-cache-action@v1
        with:
          # Specify explicitly because the ref at the time of merging will be a branch name such as 'main', 'develop'
          ref: refs/pull/${{ github.event.number }}/merge

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published