Skip to content

Commit b304d85

Browse files
ryichandoclaude
andcommitted
fix: simplify cancel-all.sh to parse workflow IDs directly
- Use jq string interpolation to output tab-separated id and name - Parse with IFS instead of re-parsing JSON objects - Increase limit to 1024 workflows 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 27704a3 commit b304d85

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

.github/workflows/scripts/cancel-all.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
# Review: Ryoichi Ando (ryoichi.ando@zozo.com)
55
# License: Apache v2.0
66

7-
gh run list --json status,workflowName,databaseId --jq '.[] | select(.status=="in_progress" or .status=="queued")' |
8-
while read -r run; do
9-
id=$(echo "$run" | jq -r '.databaseId')
10-
workflow_name=$(echo "$run" | jq -r '.workflowName')
11-
12-
echo "Canceling running workflow '$workflow_name' (#$id)"
13-
gh run cancel $id
7+
gh run list --limit 1024 --json status,workflowName,databaseId \
8+
-q '.[] | select(.status=="in_progress" or .status=="queued") | "\(.databaseId)\t\(.workflowName)"' |
9+
while IFS=$'\t' read -r id workflow_name; do
10+
echo "Canceling '$workflow_name' (#$id)"
11+
gh run cancel "$id"
1412
done

0 commit comments

Comments
 (0)