Skip to content

Instantly share code, notes, and snippets.

@sluxzer
Created December 11, 2021 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sluxzer/2a3a3d4e38cdb91879018b1f0901d969 to your computer and use it in GitHub Desktop.
Save sluxzer/2a3a3d4e38cdb91879018b1f0901d969 to your computer and use it in GitHub Desktop.
Delete Github Action Workflow
  1. Install gh cli from https://github.com/cli/cli
  2. Generate Token from https://github.com/settings/apps / https://github.com/settings/tokens
  3. Save Token to notepad
  4. Login to gh with Powershell
# authenticate against github.com by reading the token from a file
$ gh auth login --with-token < mytoken.txt
  1. Run this script
$user = "username / organzation name"
$repo = "repo name"

(gh api repos/$user/$repo/actions/runs | ConvertFrom-Json).workflow_runs |
 %{ $_.id } |
 %{ gh api repos/$user/$repo/actions/runs/$_ -X DELETE }

Ref:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment