diff --git a/.github/workflows/cancel-workflow-on-merge.yml b/.github/workflows/cancel-workflow-on-merge.yml index 44b3abdd49..e9a0403fa3 100644 --- a/.github/workflows/cancel-workflow-on-merge.yml +++ b/.github/workflows/cancel-workflow-on-merge.yml @@ -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 }} {} \ No newline at end of file + 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 }} {} \ No newline at end of file