Last active
August 11, 2023 06:33
-
-
Save sharat/9edf293950e4785663e58aecbdac9b95 to your computer and use it in GitHub Desktop.
Delete GitHub Workflow Runs based on status using GitHub CLI
This file contains 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
# Filters the runs based on the status such as failure, cancelled etc., | |
# Filter its `databaseId` with JSON fields, extract the value using `jq` then pipe it to delete | |
gh run list --status=failure --json databaseId --jq '.[] | .databaseId' | xargs -I {} gh run delete {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment