Skip to content

Commit 3328f8f

Browse files
authored
Merge pull request #10 from GeekyEggo/v2-wip
Fixes #1, closes #8, and bumps dependencies
2 parents 56e063d + d546443 commit 3328f8f

17 files changed

+5561
-1671
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
insert_final_newline = true
6+
end_of_line = crlf
7+
indent_style = space
8+
indent_size = 4
9+
10+
[{.yml}]
11+
indent_style = space
12+
indent_size = 2

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
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

Lines changed: 0 additions & 27 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Dependency directories
2-
node_modules/
2+
node_modules

README.md

Lines changed: 33 additions & 26 deletions
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+

action.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ inputs:
44
name:
55
description: The name of the artifact to delete; multiple names can be supplied on new lines.
66
required: true
7+
useGlob:
8+
description: Indicates whether the name, or names, should be treated as glob patterns.
9+
required: false
10+
default: 'true'
711
failOnError:
812
description: Indicates whether the action should fail upon encountering an error.
913
required: false
10-
default: true
14+
default: 'true'
1115
runs:
12-
using: node12
16+
using: node16
1317
main: ./dist/index.js
1418
branding:
1519
icon: trash-2

0 commit comments

Comments
 (0)