Cancel workflows if PR is updated with a new commit (#931)

* Cancel workflows if PR is updated with a new commit

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

* Fix typos

Signed-off-by: Dave Thaler <dthaler@microsoft.com>

Co-authored-by: Alan Jowett <alanjo@microsoft.com>
This commit is contained in:
Dave Thaler 2022-04-11 18:56:42 -07:00 коммит произвёл GitHub
Родитель 35bd9c6546
Коммит 64d1164e01
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 15 добавлений и 0 удалений

6
.github/workflows/cicd.yml поставляемый
Просмотреть файл

@ -13,6 +13,12 @@ on:
- cron: '00 21 * * *'
pull_request:
concurrency:
# Cancel any CI/CD workflow currently in progress for the same PR.
# Allow running concurrently with any other commits.
group: cicd-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read
checks: read # Required by reusable-test.yml to check build status.

9
.github/workflows/scorecards-analysis.yml поставляемый
Просмотреть файл

@ -1,3 +1,6 @@
# Copyright (c) Microsoft Corporation
# SPDX-License-Identifier: MIT
name: Scorecards
on:
@ -6,6 +9,12 @@ on:
pull_request:
branches: [ main ]
concurrency:
# Cancel any Scorecards workflow currently in progress for the same PR.
# Allow running concurrently with any other commits.
group: scorecards-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
# Declare default permissions as read only.
permissions: read-all