Skip to content

Commit

Permalink
Refactor remove-failed-jobs.sh for improved readability and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mauro-balades committed Jan 12, 2025
1 parent 040a8fa commit 838569e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/remove-failed-jobs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ gh_bulk_delete_workflow_runs() {

# Fetch workflow runs that are cancelled, failed, or timed out
local runs
runs=$(gh api repos/$repo/actions/runs --paginate |
jq -r '.workflow_runs[] |
runs=$(gh api repos/$repo/actions/runs --paginate \
| jq -r '.workflow_runs[] |
select(.conclusion == "cancelled" or
.conclusion == "failure" or
.conclusion == "timed_out") |
Expand All @@ -26,7 +26,7 @@ gh_bulk_delete_workflow_runs() {
# 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"
Expand Down

0 comments on commit 838569e

Please sign in to comment.