Skip to content

Commit eb580be

Browse files
authored
support prefix based deletion (#8)
1 parent 7b8bffd commit eb580be

File tree

9 files changed

+4601
-1076
lines changed

9 files changed

+4601
-1076
lines changed

README.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ A GitHub Action to delete caches from Blacksmith's cache storage. This action al
1414
1515
## Inputs
1616
17-
| Input | Description | Required |
18-
| --------- | --------------------------------------- | -------- |
19-
| `key` | The cache key to delete | Yes |
20-
| `version` | Specific version of the cache to delete | No |
17+
| Input | Description | Required | Default |
18+
| --------- | --------------------------------------- | -------- | ------- |
19+
| `key` | The cache key to delete | No\* | - |
20+
| `version` | Specific version of the cache to delete | No | - |
21+
| `prefix` | Treat key as a prefix for bulk deletion | No | false |
22+
23+
\* Required unless `prefix` is true, in which case it can be empty to match all cache keys
2124

2225
## Examples
2326

@@ -40,6 +43,26 @@ A GitHub Action to delete caches from Blacksmith's cache storage. This action al
4043
version: v1.0
4144
```
4245

46+
### Delete All Caches with a Prefix
47+
48+
```yaml
49+
- name: Delete All npm Caches
50+
uses: useblacksmith/cache-delete@v1
51+
with:
52+
key: npm-
53+
prefix: true
54+
```
55+
56+
### Delete All Caches
57+
58+
```yaml
59+
- name: Delete All Caches
60+
uses: useblacksmith/cache-delete@v1
61+
with:
62+
key: ""
63+
prefix: true
64+
```
65+
4366
## Error Handling
4467

4568
The action will:

0 commit comments

Comments
 (0)