forked from ZenBrowserMirrors/zen-desktop
Refactor remove-failed-jobs.sh for improved readability and formatting
This commit is contained in:
parent
040a8fad5b
commit
838569e386
1 changed files with 3 additions and 3 deletions
|
@ -11,8 +11,8 @@ gh_bulk_delete_workflow_runs() {
|
||||||
|
|
||||||
# Fetch workflow runs that are cancelled, failed, or timed out
|
# Fetch workflow runs that are cancelled, failed, or timed out
|
||||||
local runs
|
local runs
|
||||||
runs=$(gh api repos/$repo/actions/runs --paginate |
|
runs=$(gh api repos/$repo/actions/runs --paginate \
|
||||||
jq -r '.workflow_runs[] |
|
| jq -r '.workflow_runs[] |
|
||||||
select(.conclusion == "cancelled" or
|
select(.conclusion == "cancelled" or
|
||||||
.conclusion == "failure" or
|
.conclusion == "failure" or
|
||||||
.conclusion == "timed_out") |
|
.conclusion == "timed_out") |
|
||||||
|
@ -26,7 +26,7 @@ gh_bulk_delete_workflow_runs() {
|
||||||
# Loop through each run and delete it
|
# Loop through each run and delete it
|
||||||
while IFS= read -r run; do
|
while IFS= read -r run; do
|
||||||
echo "Attempting to delete run: https://github.com/$repo/actions/runs/$run"
|
echo "Attempting to delete run: https://github.com/$repo/actions/runs/$run"
|
||||||
|
|
||||||
# Perform the deletion
|
# Perform the deletion
|
||||||
if gh api -X DELETE repos/$repo/actions/runs/$run --silent; then
|
if gh api -X DELETE repos/$repo/actions/runs/$run --silent; then
|
||||||
echo "Successfully deleted run: $run"
|
echo "Successfully deleted run: $run"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue