forked from useblacksmith/cache-delete
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*: initial scaffolding for the stickydisk action
- Loading branch information
1 parent
c27f005
commit 76e48d2
Showing
9 changed files
with
27,848 additions
and
23,017 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Basic Sticky Disk Test | ||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test-sticky-disk: | ||
name: Test Sticky Disk | ||
runs-on: blacksmith-staging | ||
steps: | ||
- name: Mount Sticky Disk | ||
uses: useblacksmith/stickydisk@initial-commit | ||
with: | ||
key: foo | ||
path: /shouldseethis | ||
|
||
- name: List directory if exists | ||
run: | | ||
if [ -d "/shouldseethis" ]; then | ||
ls -la /shouldseethis | ||
fi | ||
- name: Write test file | ||
run: sudo sh -c 'echo "Hello from sticky disk" > /shouldseethis/test.txt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,3 @@ | ||
# Blacksmith Cache Delete Action | ||
# Blacksmith Sticky Disk Action | ||
|
||
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. | ||
|
||
## Usage | ||
|
||
```yaml | ||
- name: Delete Cache | ||
uses: useblacksmith/cache-delete@v1 | ||
with: | ||
key: Linux-composer-ecf6e2e236589e4d34ba89662b6bc2afe8e15237cd19a13df9dc0cb599ff4826 | ||
version: v213asda2cf # Optional: specific version to delete | ||
``` | ||
## Inputs | ||
| 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 | ||
|
||
## Examples | ||
|
||
### Delete All Versions of a Cache | ||
|
||
```yaml | ||
- name: Delete All Cache Versions | ||
uses: useblacksmith/cache-delete@v1 | ||
with: | ||
key: npm-cache | ||
``` | ||
|
||
### Delete a Specific Cache Version | ||
|
||
```yaml | ||
- name: Delete Specific Cache Version | ||
uses: useblacksmith/cache-delete@v1 | ||
with: | ||
key: npm-cache | ||
version: v1.0 | ||
``` | ||
|
||
### Delete All Caches with a Prefix | ||
|
||
```yaml | ||
- name: Delete All npm Caches | ||
uses: useblacksmith/cache-delete@v1 | ||
with: | ||
key: npm- | ||
prefix: true | ||
``` | ||
|
||
### Delete All Caches | ||
|
||
```yaml | ||
- name: Delete All Caches | ||
uses: useblacksmith/cache-delete@v1 | ||
with: | ||
key: "" | ||
prefix: true | ||
``` | ||
|
||
## Error Handling | ||
|
||
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 | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. | ||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,16 @@ | ||
name: "Delete Blacksmith Cache" | ||
author: Aayush Shah | ||
description: "Deletes a cache or specific cache version from Blacksmith" | ||
name: "Blacksmith Sticky Disk" | ||
author: Aditya Maru | ||
description: "Creates a sticky disk on Blacksmith" | ||
branding: | ||
icon: folder-plus | ||
color: black | ||
inputs: | ||
key: | ||
description: "The cache key to delete" | ||
required: false | ||
version: | ||
description: "Specific version of the cache to delete (optional)" | ||
required: false | ||
prefix: | ||
description: "Treat key as a prefix for bulk deletion" | ||
required: false | ||
default: "false" | ||
description: "A unique key to identify the sticky disk" | ||
required: true | ||
path: | ||
description: "The path at which to mount the sticky disk" | ||
required: true | ||
runs: | ||
using: "node20" | ||
main: "dist/index.js" |
Oops, something went wrong.