2023-05-23 16:41:40 +00:00
|
|
|
#!/bin/sh -xe
|
2023-07-27 13:40:53 +00:00
|
|
|
#
|
|
|
|
# Keep last runs of master and release-test
|
2023-05-23 16:41:40 +00:00
|
|
|
|
2023-07-27 13:40:53 +00:00
|
|
|
workflow='Static binaries'
|
2023-05-23 16:41:40 +00:00
|
|
|
repo="kdave/btrfs-progs"
|
|
|
|
|
2023-07-27 13:40:53 +00:00
|
|
|
type -p gh > /dev/null || { echo "ERROR: gh tool not found"; exit 1; }
|
|
|
|
type -p jq > /dev/null || { echo "ERROR: jq tool not found"; exit 1; }
|
2023-05-23 16:41:40 +00:00
|
|
|
|
2023-07-27 13:40:53 +00:00
|
|
|
for branch in master release-test; do
|
2024-08-16 19:34:28 +00:00
|
|
|
for id in $(gh run -R "$repo" list --limit 100 --workflow "$workflow" --branch "$branch" --json databaseId | jq '.[1:] | .[].databaseId'); do
|
2023-07-27 13:40:53 +00:00
|
|
|
echo "Delete run $id"
|
|
|
|
gh run -R "$repo" delete "$id"
|
|
|
|
done
|
2023-05-23 16:41:40 +00:00
|
|
|
done
|