2023-08-22 19:16:05 +00:00
|
|
|
#!/bin/sh -xe
|
|
|
|
#
|
|
|
|
# Keep last runs of master and coverage-test
|
|
|
|
|
|
|
|
workflow='Code coverage tests'
|
|
|
|
repo="kdave/btrfs-progs"
|
|
|
|
|
|
|
|
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; }
|
|
|
|
|
|
|
|
for branch in master coverage-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-08-22 19:16:05 +00:00
|
|
|
echo "Delete run $id"
|
|
|
|
gh run -R "$repo" delete "$id"
|
|
|
|
done
|
|
|
|
done
|