btrfs-progs: ci: add cleanup script for coverage tests

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2023-08-22 21:16:05 +02:00
parent 5b9206727b
commit 55bed0a8db
1 changed files with 16 additions and 0 deletions

16
ci/actions/keep-last-coverage Executable file
View File

@ -0,0 +1,16 @@
#!/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
for id in $(gh run -R "$repo" list --workflow "$workflow" --branch "$branch" --json databaseId | jq '.[1:] | .[].databaseId'); do
echo "Delete run $id"
gh run -R "$repo" delete "$id"
done
done