#!/bin/bash ORG="gigb-official" REPO="django-gigb" WORKFLOW="lint.yml" gh config set pager cat WORKFLOW_RUNS=$(gh api -H "Accept: application/vnd.github.v3+json" "/repos/$ORG/$REPO/actions/workflows/$WORKFLOW/runs?per_page=100" | jq '.workflow_runs[] | .id') WORKFLOW_RUNS=($WORKFLOW_RUNS) for s in "${WORKFLOW_RUNS[@]}"; do gh api --method DELETE -H "Accept: application/vnd.github.v3+json" /repos/$ORG/$REPO/actions/runs/$s done gh config set pager less