A GitHub Action to delete caches from Blacksmith's cache storage. This action allows you to delete either a specific cache version or all versions of a cache key. This action only works Blacksmith runners.
- name: Delete Cache
uses: useblacksmith/cache-delete@v1
with:
key: Linux-composer-ecf6e2e236589e4d34ba89662b6bc2afe8e15237cd19a13df9dc0cb599ff4826
version: v213asda2cf # Optional: specific version to delete
Input | Description | Required | Default |
---|---|---|---|
key |
The cache key to delete | No* | - |
version |
Specific version of the cache to delete | No | - |
prefix |
Treat key as a prefix for bulk deletion | No | false |
* Required unless prefix
is true, in which case it can be empty to match all cache keys
- name: Delete All Cache Versions
uses: useblacksmith/cache-delete@v1
with:
key: npm-cache
- name: Delete Specific Cache Version
uses: useblacksmith/cache-delete@v1
with:
key: npm-cache
version: v1.0
- name: Delete All npm Caches
uses: useblacksmith/cache-delete@v1
with:
key: npm-
prefix: true
- name: Delete All Caches
uses: useblacksmith/cache-delete@v1
with:
key: ""
prefix: true
The action will:
- Fail if the cache deletion request fails (non-404 error)
- Log a message if the cache is not found (404)
- Successfully complete if the cache is deleted
This project is licensed under the MIT License - see the LICENSE file for details.