Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
6642e3a2
Unverified
Commit
6642e3a2
authored
Aug 08, 2025
by
Lianmin Zheng
Committed by
GitHub
Aug 08, 2025
Browse files
[Fix] Add a workflow to cancel all pending CI runs (#8988)
parent
67a7d1f6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
.github/workflows/cancel-all-pending-pr-test-runs.yml
.github/workflows/cancel-all-pending-pr-test-runs.yml
+9
-10
No files found.
.github/workflows/cancel-all-pending-pr-test-runs.yml
View file @
6642e3a2
name
:
Cancel All Pending PR Test Runs
on
:
workflow_dispatch
:
# Manual trigger
workflow_dispatch
:
permissions
:
actions
:
write
# Needed to cancel runs
contents
:
read
# Needed to read repo info
jobs
:
cancel-pending
:
runs-on
:
ubuntu-latest
steps
:
-
name
:
Install GitHub CLI
run
:
apt-get install -y gh jq
-
name
:
Authenticate GitHub CLI
env
:
GH_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
run
:
gh auth login --with-token <<< "$GH_TOKEN"
run
:
sudo apt-get install -y gh jq
-
name
:
Cancel all pending/waiting pr-test.yml runs
env
:
GH_TOKEN
:
${{ secrets.GITHUB_TOKEN }}
REPO
:
${{ github.repository }}
run
:
|
# Get all pending or waiting runs of pr-test.yml across all branches
gh run list \
--repo "$REPO" \
--workflow pr-test.yml \
--json databaseId,status
,conclusion
\
--json databaseId,status \
--limit 1000 \
| jq -r '.[] | select(.status=="queued" or .status=="in_progress") | .databaseId' \
| while read run_id; do
echo "Cancelling run ID: $run_id"
gh run cancel "$run_id"
gh run cancel "$run_id"
--repo "$REPO"
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment