refactor: break long line into multiple lines for readability

Signed-off-by: WANG Xu <feici02@outlook.com>
This commit is contained in:
WANG Xu 2025-03-13 17:29:13 +08:00
parent 8c8b013565
commit ab8e2b7590
No known key found for this signature in database
GPG Key ID: 243B1A4F56B56F50
1 changed files with 9 additions and 1 deletions

View File

@ -1,4 +1,5 @@
name: Cancel Workflow on Merge or Close
description: Cancels the workflow if the PR is merged or closed to avoid unnecessary runs.
on:
pull_request:
@ -15,4 +16,11 @@ jobs:
run: |
echo "PR has been merged or closed, cancelling workflow..."
gh auth status
gh run list --repo ${{ github.repository }} --branch ${{ github.event.pull_request.head.ref }} --workflow "TDengine Test" --status in_progress --status queued --json databaseId --jq '.[].databaseId' | xargs -I {} gh run cancel --repo ${{ github.repository }} {}
gh run list \
--repo ${{ github.repository }} \
--branch ${{ github.event.pull_request.head.ref }} \
--workflow "TDengine Test" \
--status in_progress \
--status queued
--json databaseId --jq '.[].databaseId' | \
xargs -I {} gh run cancel --repo ${{ github.repository }} {}