Skip to content

feat[ts-6107]: shared storage #1096

feat[ts-6107]: shared storage

feat[ts-6107]: shared storage #1096

name: Cancel Workflow on Merge
on:
pull_request:
types: [closed]
jobs:
cancel-workflow:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Cancel Workflow if Merged or Closed
if: ${{ github.event.pull_request.merged || github.event.pull_request.state == 'closed' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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" \
--json databaseId,name,status \
--jq '.[] | select(.status == "in_progress" or .status == "queued") | .databaseId ' | \
xargs -I {} gh run cancel --repo ${{ github.repository }} {}