Skip to content

Commit d6405ec

Browse files
authored
Optimize workflow runs with concurrency settings (#23811)
* Add concurrency settings for a bunch of workflows * Restrict prod deployments to one at a time but disallow interrupting * Remove redundant pull_request.types specification
1 parent 65ce874 commit d6405ec

24 files changed

+118
-27
lines changed

.github/workflows/autoupdate-branch.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ on:
2727
permissions:
2828
contents: read
2929

30+
# This allows a subsequently queued workflow run to take priority over
31+
# previously queued runs but NOT interrupt currently executing runs
32+
concurrency:
33+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
34+
cancel-in-progress: false
35+
3036
jobs:
3137
autoupdate:
3238
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'

.github/workflows/browser-test.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,20 @@ on:
2222
permissions:
2323
contents: read
2424

25+
# This allows a subsequently queued workflow run to interrupt previous runs
26+
concurrency:
27+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
28+
cancel-in-progress: true
29+
2530
jobs:
2631
build:
2732
runs-on: ubuntu-latest
2833
steps:
29-
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
30-
# Even if if doesn't do anything
3134
- name: Checkout
3235
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
3336
with:
3437
lfs: true
38+
3539
- name: Checkout LFS objects
3640
run: git lfs checkout
3741

.github/workflows/code-lint.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ name: Lint code
66

77
on:
88
workflow_dispatch:
9-
push:
10-
branches:
11-
- main
129
pull_request:
1310
paths:
1411
- '**.js'
@@ -27,6 +24,11 @@ on:
2724
permissions:
2825
contents: read
2926

27+
# This allows a subsequently queued workflow run to interrupt previous runs
28+
concurrency:
29+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
30+
cancel-in-progress: true
31+
3032
jobs:
3133
lint:
3234
runs-on: ubuntu-latest

.github/workflows/codeql.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ permissions:
2020
contents: read
2121
security-events: write
2222

23+
# This allows a subsequently queued workflow run to interrupt previous runs
24+
concurrency:
25+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
26+
cancel-in-progress: true
27+
2328
jobs:
2429
build:
2530
if: github.repository == 'github/docs-internal' || github.repository == 'github/docs'

.github/workflows/content-changes-table-comment.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ name: Content Changes Table Comment
77
on:
88
workflow_dispatch:
99
pull_request_target:
10-
types: [opened, synchronize, reopened]
1110

1211
permissions:
1312
contents: read
1413
pull-requests: write
1514

15+
# This allows a subsequently queued workflow run to interrupt previous runs
16+
concurrency:
17+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
18+
cancel-in-progress: true
19+
1620
jobs:
1721
PR-Preview-Links:
1822
if: github.event.pull_request.user.login != 'Octomerger'

.github/workflows/crowdin-cleanup.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
permissions:
1414
contents: write
1515

16+
# This allows a subsequently queued workflow run to interrupt previous runs
17+
concurrency:
18+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
19+
cancel-in-progress: true
20+
1621
jobs:
1722
homogenize_frontmatter:
1823
name: Homogenize frontmatter

.github/workflows/enterprise-release-sync-search-index.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ on:
2929
permissions:
3030
contents: write
3131

32+
# This allows a subsequently queued workflow run to interrupt previous runs
33+
concurrency:
34+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
35+
cancel-in-progress: true
36+
3237
# This workflow requires a label in the format `sync-english-index-for-<PLAN@RELEASE>`
3338
jobs:
3439
updateIndices:

.github/workflows/link-check-all.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ permissions:
1616
# Needed for the 'trilom/file-changes-action' action
1717
pull-requests: read
1818

19+
# This allows a subsequently queued workflow run to interrupt previous runs
20+
concurrency:
21+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
22+
cancel-in-progress: true
23+
1924
jobs:
2025
build:
2126
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
@@ -55,7 +60,6 @@ jobs:
5560
5661
- name: Link check (critical, all files)
5762
run: |
58-
5963
./script/rendered-content-link-checker.mjs \
6064
--language en \
6165
--exit \

.github/workflows/link-check-dotcom.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
permissions:
1212
contents: read
1313

14+
# This allows a subsequently queued workflow run to interrupt previous runs
15+
concurrency:
16+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
17+
cancel-in-progress: true
18+
1419
jobs:
1520
build:
1621
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}

.github/workflows/link-check-ghae.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
permissions:
1212
contents: read
1313

14+
# This allows a subsequently queued workflow run to interrupt previous runs
15+
concurrency:
16+
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
17+
cancel-in-progress: true
18+
1419
jobs:
1520
build:
1621
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}

0 commit comments

Comments
 (0)