Skip to content

Commit 6545e41

Browse files
committed
fix: artifact
Signed-off-by: Innei <[email protected]>
1 parent c901dbb commit 6545e41

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.github/workflows/build.yml

+1
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ jobs:
4040
with:
4141
name: artifact
4242
path: assets/release.zip
43+
overwrite: true

scripts/delete-ci-build-artifact.mjs

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
})

0 commit comments

Comments
 (0)