I had to redo my azure CI/CD action because M$ removed my old static web site (cleaning out old MSDN licensed resources). I now had two actions in my repository and only one worked. There does not seem to be any delete function in the github interface for actions.
This is how I deleted the old action.
- disable the bad actor
- install snap gh on linux
- gh auth
- run the following powershell script
- delete the yml file for the old action in .github/workflows
$repo = "myrepo.isnowhere.org"
$org = "myGitUser"
$workflow_ids=($(gh api repos/$org/$repo/actions/workflows | jq '.workflows[] | select(.["state"] | contains("disabled_manually")) | .id'))
foreach ($wf in $workflow_ids) {
write-host "Listing runs for the workflow ID $wf"
$run_ids = ( $(gh api repos/$org/$repo/actions/workflows/$wf/runs --paginate | jq '.workflow_runs[].id') )
foreach ($r in $run_ids) {
write-host "Deleting Run ID $r"
gh api repos/$org/$repo/actions/runs/$r -X DELETE >/dev/null
}
}