File tree 2 files changed +25
-0
lines changed
2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 40
40
with :
41
41
name : artifact
42
42
path : assets/release.zip
43
+ overwrite : true
Original file line number Diff line number Diff line change
1
+ import { $fetch } from 'ofetch'
2
+
3
+ const gh_token = process . env . GH_TOKEN
4
+
5
+ const namespace = 'innei-dev/Shiroi'
6
+
7
+ const myFetch = $fetch . create ( {
8
+ headers : {
9
+ Authorization : `Bearer ${ gh_token } ` ,
10
+ } ,
11
+ } )
12
+ const data = await myFetch (
13
+ `https://api.github.com/repos/${ namespace } /actions/artifacts` ,
14
+ )
15
+
16
+ data . artifacts . forEach ( async ( artifact ) => {
17
+ if ( artifact . name === 'artifact' ) {
18
+ console . log ( 'deleting' , artifact . id )
19
+ await myFetch (
20
+ `https://api.github.com/repos/${ namespace } /actions/artifacts/${ artifact . id } ` ,
21
+ { method : 'DELETE' } ,
22
+ )
23
+ }
24
+ } )
You can’t perform that action at this time.
0 commit comments