-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add glob support, switch to TypeScript, and bump deps
- Loading branch information
Showing
14 changed files
with
5,542 additions
and
1,668 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,63 @@ | ||
name: CI | ||
# an example workflow that also monitors success of the preview api | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
schedule: | ||
- cron: '0 */6 * * *' | ||
# every 6 hours | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
test: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Create test file | ||
run: echo hello > world.txt | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: my-artifact | ||
path: world.txt | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: my-artifact-2 | ||
path: world.txt | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: my-artifact-3 | ||
path: world.txt | ||
|
||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: you-artifact | ||
path: world.txt | ||
|
||
- name: Delete (specific, glob disabled) | ||
uses: ./ | ||
with: | ||
name: my-artifact | ||
useGlob: false | ||
|
||
- name: Delete (pattern, glob enabled) | ||
uses: ./ | ||
with: | ||
name: my-* | ||
|
||
- name: Delete (specific, glob enabled) | ||
uses: ./ | ||
with: | ||
name: you-artifact |
This file was deleted.
Oops, something went wrong.
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,50 +1,57 @@ | ||
![Example](https://github.com/GeekyEggo/delete-artifact/workflows/CI/badge.svg) | ||
|
||
# Delete artifacts | ||
|
||
A GitHub Action for deleting artifacts within the workflow run. This can be useful when artifacts are shared across jobs, but are no longer needed when the workflow is complete. | ||
|
||
## Usage | ||
## ⚡ Usage | ||
|
||
See [action.yml](action.yml) | ||
|
||
### Delete an individual artifact | ||
|
||
```yml | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v2 | ||
|
||
- run: echo hello > world.txt | ||
- run: echo hello > world.txt | ||
|
||
- uses: actions/upload-artifact@v1 | ||
with: | ||
name: my-artifact | ||
path: world.txt | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: my-artifact | ||
path: world.txt | ||
|
||
# delete-artifact | ||
- uses: geekyeggo/delete-artifact@v1 | ||
with: | ||
name: my-artifact | ||
# delete-artifact | ||
- uses: geekyeggo/delete-artifact@v2 | ||
with: | ||
name: my-artifact | ||
``` | ||
## Multiple artifacts | ||
### Specify multiple names | ||
Deleting multiple artifacts within a single action can be achieved by specifying each artifact name on a new line; this can improve performance when deleting more than one artifact. | ||
```yml | ||
steps: | ||
- uses: geekyeggo/delete-artifact@v1 | ||
with: | ||
name: | | ||
artifact-one | ||
artifact-two | ||
artifact-three | ||
- uses: geekyeggo/delete-artifact@2 | ||
with: | ||
name: | | ||
artifact-* | ||
binary-file | ||
output | ||
``` | ||
## Error vs Fail | ||
## 🚨 Error vs Fail | ||
By default, the action will fail when it was not possible to delete an artifact (with the exception of name mismatches). When the deletion of an artifact is not integral to the success of a workflow, it is possible to error without failure. All errors are logged. | ||
```yml | ||
steps: | ||
- uses: geekyeggo/delete-artifact@v1 | ||
with: | ||
name: okay-to-keep | ||
failOnError: false | ||
- uses: geekyeggo/delete-artifact@v2 | ||
with: | ||
name: okay-to-keep | ||
failOnError: false | ||
``` | ||
## ⚠ Disclaimer | ||
## Disclaimer | ||
This action utilizes a preview version of GitHub's runtime API; the API is subject to change at any time which may result in failures of this action. | ||
Oops, something went wrong.