Created
June 10, 2024 19:22
-
-
Save ypelud/3a0d9dbbeac7a4393ccc47f69caddd24 to your computer and use it in GitHub Desktop.
delete runs in Github actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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