From 322a59a73cafeb6ff47bce7f228a3cc331155069 Mon Sep 17 00:00:00 2001 From: Dmitriy Kholkin Date: Thu, 25 Jan 2024 21:04:51 +0300 Subject: [PATCH] shell script to remove all github runs --- profiles/workspace/zsh/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/profiles/workspace/zsh/default.nix b/profiles/workspace/zsh/default.nix index b6b5c8b..9c07b25 100644 --- a/profiles/workspace/zsh/default.nix +++ b/profiles/workspace/zsh/default.nix @@ -126,6 +126,19 @@ file="''${file%.*}" ffmpeg -i "$1" -c:v libvpx-vp9 -b:v 0 -crf 30 -an "$dir/$file.webm" } + gh_delete_runs() { + org="$1" + repo="$2" + set -a + source /run/secrets/github-token + set +a + run_ids=($(${pkgs.gh}/bin/gh api repos/$org/$repo/actions/runs --paginate --jq '.workflow_runs[] | .id')) + for run_id in "''${run_ids[@]}" + do + echo "Deleting Run ID $run_id" + ${pkgs.gh}/bin/gh api repos/$org/$repo/actions/runs/$run_id --method DELETE >/dev/null & + done + } XDG_DATA_DIRS=$XDG_DATA_DIRS:$GSETTINGS_SCHEMAS_PATH