Skip to content

Commit 424f35a

Browse files
committed
Add glob support, switch to TypeScript, and bump deps
1 parent 442f120 commit 424f35a

14 files changed

+5542
-1668
lines changed

.github/workflows/ci.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI
2+
# an example workflow that also monitors success of the preview api
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
9+
schedule:
10+
- cron: '0 */6 * * *'
11+
# every 6 hours
12+
13+
defaults:
14+
run:
15+
shell: bash
16+
17+
jobs:
18+
test:
19+
runs-on: windows-latest
20+
21+
steps:
22+
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
26+
- name: Create test file
27+
run: echo hello > world.txt
28+
29+
- uses: actions/upload-artifact@v2
30+
with:
31+
name: my-artifact
32+
path: world.txt
33+
34+
- uses: actions/upload-artifact@v2
35+
with:
36+
name: my-artifact-2
37+
path: world.txt
38+
39+
- uses: actions/upload-artifact@v2
40+
with:
41+
name: my-artifact-3
42+
path: world.txt
43+
44+
- uses: actions/upload-artifact@v2
45+
with:
46+
name: you-artifact
47+
path: world.txt
48+
49+
- name: Delete (specific, glob disabled)
50+
uses: ./
51+
with:
52+
name: my-artifact
53+
useGlob: false
54+
55+
- name: Delete (pattern, glob enabled)
56+
uses: ./
57+
with:
58+
name: my-*
59+
60+
- name: Delete (specific, glob enabled)
61+
uses: ./
62+
with:
63+
name: you-artifact

.github/workflows/example.yml

-27
This file was deleted.

README.md

+33-26
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,57 @@
1+
![Example](https://github.com/GeekyEggo/delete-artifact/workflows/CI/badge.svg)
2+
13
# Delete artifacts
4+
25
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.
36

4-
## Usage
7+
## ⚡ Usage
8+
9+
See [action.yml](action.yml)
10+
11+
### Delete an individual artifact
12+
513
```yml
614
steps:
7-
- uses: actions/checkout@v1
15+
- uses: actions/checkout@v2
816

9-
- run: echo hello > world.txt
17+
- run: echo hello > world.txt
1018

11-
- uses: actions/upload-artifact@v1
12-
with:
13-
name: my-artifact
14-
path: world.txt
19+
- uses: actions/upload-artifact@v2
20+
with:
21+
name: my-artifact
22+
path: world.txt
1523

16-
# delete-artifact
17-
- uses: geekyeggo/delete-artifact@v1
18-
with:
19-
name: my-artifact
24+
# delete-artifact
25+
- uses: geekyeggo/delete-artifact@v2
26+
with:
27+
name: my-artifact
2028
```
2129
22-
## Multiple artifacts
30+
### Specify multiple names
2331
24-
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.
2532
```yml
2633
steps:
27-
- uses: geekyeggo/delete-artifact@v1
28-
with:
29-
name: |
30-
artifact-one
31-
artifact-two
32-
artifact-three
34+
- uses: geekyeggo/delete-artifact@2
35+
with:
36+
name: |
37+
artifact-*
38+
binary-file
39+
output
3340
```
3441
35-
## Error vs Fail
42+
## 🚨 Error vs Fail
3643
3744
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.
3845
3946
```yml
4047
steps:
41-
- uses: geekyeggo/delete-artifact@v1
42-
with:
43-
name: okay-to-keep
44-
failOnError: false
48+
- uses: geekyeggo/delete-artifact@v2
49+
with:
50+
name: okay-to-keep
51+
failOnError: false
4552
```
4653
54+
## ⚠ Disclaimer
4755
48-
49-
## Disclaimer
5056
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.
57+

0 commit comments

Comments
 (0)