Files
desktop/scripts/remove-failed-jobs.sh
zeekay 6b0493fd54 Rebrand zen-browser to enso-browser
Complete rebranding of desktop browser from Zen Browser to Enso Browser.
Updated surfer.json (app ID, binary name, brands, update hostname),
mozconfig, package.json, all patch files (app identifiers, URLs, macOS
signing), build scripts, flatpak manifest, desktop entry, CI/CD workflows,
localization files, branding assets (new enso circle logo), and all
source code references. Renamed CSS files and updated DOM element IDs.
2026-02-09 22:43:54 -08:00

49 lines
1.4 KiB
Bash

#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
gh_bulk_delete_workflow_runs() {
local repo=enso-browser/$1
# Ensure the repo argument is provided
if [[ -z "$repo" ]]; then
echo "Usage: gh_bulk_delete_workflow_runs <repo>"
return 1
fi
# Fetch workflow runs that are cancelled, failed, or timed out
local runs
runs=$(gh api repos/$repo/actions/runs --paginate \
| jq -r '.workflow_runs[] |
select(.conclusion == "cancelled" or
.conclusion == "failure" or
.conclusion == "timed_out") |
.id')
if [[ -z "$runs" ]]; then
echo "No workflow runs found for $repo with the specified conclusions."
return 0
fi
# Loop through each run and delete it
while IFS= read -r run; do
echo "Attempting to delete run: https://github.com/$repo/actions/runs/$run"
# Perform the deletion
if gh api -X DELETE repos/$repo/actions/runs/$run --silent; then
echo "Successfully deleted run: $run"
else
echo "Error deleting run: $run" >&2
fi
# Optional delay to avoid hitting API rate limits
sleep 1
done <<< "$runs"
echo "Completed deletion process for workflow runs in $repo."
}
# Execute the function with the provided argument
gh_bulk_delete_workflow_runs "$1"