Skip to content

Commit

Permalink
feat: Asset deletion script feature complete
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaurin committed May 28, 2024
1 parent 88d3ebc commit 66dc7e3
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions scripts/delete_gh_release_assets.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash

set -e
set -o pipefail

# Delete all 7z files from a GitHub release
# Usage: delete_gh_release_assets <release>
Expand All @@ -9,18 +10,8 @@ function delete_gh_release_assets() {
gh release view "$1" --json assets -q '.assets[].name' | grep '\.7z$' | xargs -n1 gh release delete-asset "$1"
}

# You can get a list of releases by running:
# gh release list
export -f delete_gh_release_assets

delete_gh_release_assets "v0.9.13+2023-06-18-001"
delete_gh_release_assets "v0.9.13+2023-06-01-001"
delete_gh_release_assets "v0.9.13+2023-05-31-001"
delete_gh_release_assets "v0.9.12+2023-05-07-001"
delete_gh_release_assets "v0.9.11+2023-03-31-002"
delete_gh_release_assets "v0.9.10+2023-03-17-001"
delete_gh_release_assets "v0.9.9+2023-03-08-001"
delete_gh_release_assets "v0.9.9+2023-03-07-001"
delete_gh_release_assets "v0.9.8+2023-03-05-001"
delete_gh_release_assets "v0.9.8+2023-02-26-001"
delete_gh_release_assets "v0.9.7+2023-01-29-001"
delete_gh_release_assets "v0.9.6+2022-12-15-001"
# Deletes all assets from all releases except from the latest release
# Documentation: Call bash function via xargs: https://unix.stackexchange.com/questions/158564/how-to-use-defined-function-with-xargs
gh release list --json tagName -q '.[1:].[].tagName' | xargs -n1 bash -c 'delete_gh_release_assets "$@"' _

0 comments on commit 66dc7e3

Please sign in to comment.