Skip to content

Instantly share code, notes, and snippets.

@ronek22
Created July 28, 2022 06:07
Show Gist options
  • Select an option

  • Save ronek22/29940b4db1821509ec730e46b60b97e5 to your computer and use it in GitHub Desktop.

Select an option

Save ronek22/29940b4db1821509ec730e46b60b97e5 to your computer and use it in GitHub Desktop.

Revisions

  1. ronek22 created this gist Jul 28, 2022.
    2 changes: 2 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,2 @@
    ### Requirements
    - GitHub CLI
    16 changes: 16 additions & 0 deletions script.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    #!/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