Whenever a branch is pushed to a repository which has GitHub Actions
enabled, a bunch of new workflow runs are started.
We sometimes see contributors push multiple branch updates in rapid
succession, which in conjunction with the impressive time swallowed by
even just a single CI build frequently leads to many queued-up runs.
This is particularly problematic in the case of Pull Requests where a
single contributor can easily (inadvertently) prevent timely builds for
other contributors when using a shared repository.
To help with this situation, let's use the `concurrency` feature of
GitHub workflows, essentially canceling GitHub workflow runs that are
obsoleted by more recent runs:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#concurrency
For workflows that *do* want the behavior in the pre-image of this
patch, they can use the ci-config feature to disable the new behavior by
adding an executable script on the ci-config branch called
'skip-concurrent' which terminates with a non-zero exit code.
Original-patch-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Taylor Blau committedNov 8, 2022 at 13:25 UTCeb5b03a9c0a0c8b4d82ece6069821de41b06722b
3 files changed+50-2
.github/workflows/check-whitespace.yml
+6
index ad3466ad16..0bcc9cffbd 100644--- a/.github/workflows/check-whitespace.yml+++ b/.github/workflows/check-whitespace.yml@@ -9,6 +9,12 @@ on: pull_request: types: [opened, synchronize]+# Avoid unnecessary builds. Unlike the main CI jobs, these are not+# ci-configurable (but could be).+concurrency:+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true+ jobs: check-whitespace: runs-on: ubuntu-latest
.github/workflows/l10n.yml
+6
index 27f72f0ff3..51fd46e6af 100644--- a/.github/workflows/l10n.yml+++ b/.github/workflows/l10n.yml@@ -2,6 +2,12 @@ name: git-l10n on: [push, pull_request_target]+# Avoid unnecessary builds. Unlike the main CI jobs, these are not+# ci-configurable (but could be).+concurrency:+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: true+ jobs: git-po-helper: if: >-