Skip to content
database

GitHub Action

Purge cache for Moe

v2.1.0 Latest version

Purge cache for Moe

database

Purge cache for Moe

Purge GitHub Actions cache

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Purge cache for Moe

uses: MoeKernel/[email protected]

Learn more about this action in MoeKernel/purge-cache

Choose a version

purge-cache

This action allows the cache of GitHub Actions to be automatically purged

Basic usage

See action.yml

steps:
# Do other steps like checkout, install, compile, etc.
- uses: MyAlbum/purge-cache@v2
  with:
    accessed: true # Purge caches by their last accessed time (default)
    created: false # Purge caches by their created time (default)
    max-age: 604800 # Leave only caches accessed in the last 7 days (default)

Example workflow

See ci.yaml

Other options

Debug

Output debug data (defaults to false)

  • Number of caches
  • Skipped caches
  • Deleted caches
steps:
# Do other steps like checkout, install, compile, etc.
- uses: MyAlbum/purge-cache@v2
  with:
    debug: true # Set to true to output debug info

Token

Set a GitHub token, will default to ${github.token}. This will probably not be nessesary as the default token should be sufficient.

In case custom permissions are set for the tokens used in your actions workflow, to purge existing caches, the permission:

actions: write

needs to be available for the token.

steps:
# Do other steps like checkout, install, compile, etc.
- uses: MyAlbum/purge-cache@v2
  with:
    token: $GITHUBTOKEN # Set a GitHub token