ci: add workflow to cancel ongoing runs on pull request merge
This commit is contained in:
parent
47344da619
commit
055154173b
|
@ -0,0 +1,15 @@
|
|||
name: Cancel Workflow on Merge
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
|
||||
jobs:
|
||||
cancel-workflow:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cancel Workflow if Merged
|
||||
if: ${{ github.event.pull_request.merged }}
|
||||
run: |
|
||||
echo "PR has been merged, cancelling workflow..."
|
||||
gh run cancel --repo ${{ github.repository }} --workflow "TDengine Test" --branch ${{ github.event.pull_request.base.ref }}
|
|
@ -11,7 +11,7 @@ on:
|
|||
- 'docs/**'
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}-TDengine
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
|
|
Loading…
Reference in New Issue