Skip to content

Instantly share code, notes, and snippets.

@ypelud
Created June 10, 2024 19:22
Show Gist options
  • Select an option

  • Save ypelud/3a0d9dbbeac7a4393ccc47f69caddd24 to your computer and use it in GitHub Desktop.

Select an option

Save ypelud/3a0d9dbbeac7a4393ccc47f69caddd24 to your computer and use it in GitHub Desktop.
delete runs in Github actions
# Adapted from https://blog.oddbit.com/post/2022-09-22-delete-workflow-runs/
export REPO_NAME="owner/myrepo"
export WORKFLOW_NAME="myworkflow"
gh run list --json databaseId --repo ${REPO_NAME} -w "${WORKFLOW_NAME}" -q '.[].databaseId' |
xargs -IID gh api "repos/${REPO_NAME}/actions/runs/ID" -X DELETE --silent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment