Skip to content

Commit

Permalink
fix: artifact
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Apr 12, 2024
1 parent c901dbb commit 6545e41
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,4 @@ jobs:
with:
name: artifact
path: assets/release.zip
overwrite: true
24 changes: 24 additions & 0 deletions scripts/delete-ci-build-artifact.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { $fetch } from 'ofetch'

const gh_token = process.env.GH_TOKEN

const namespace = 'innei-dev/Shiroi'

const myFetch = $fetch.create({
headers: {
Authorization: `Bearer ${gh_token}`,
},
})
const data = await myFetch(
`https://github.com/gitapi/repos/${namespace}/actions/artifacts`,
)

data.artifacts.forEach(async (artifact) => {
if (artifact.name === 'artifact') {
console.log('deleting', artifact.id)
await myFetch(
`https://github.com/gitapi/repos/${namespace}/actions/artifacts/${artifact.id}`,
{ method: 'DELETE' },
)
}
})

0 comments on commit 6545e41

Please sign in to comment.