Skip to content

Commit 064bd17

Browse files
committed
CI: Deploy concurrency and path filtering for Action activation
Reduce unnecessary churn by skipping CI Action for documentation-only changes. Also, avoid duplicate Actions on pushes to PR branches (which trigger both the `push` and `pull_request` events). Finally, cancel earlier Actions still running when a non-main branch is updated, as these are usually unneeded, and the superceded Action can even cause spurious failures after a subsequent force push orphans the source commit.
1 parent 5053295 commit 064bd17

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
name: Build
22

3-
on: [push, pull_request]
4-
3+
on:
4+
push:
5+
paths-ignore: &paths_ignore
6+
- 'docs/**'
7+
- '**.txt'
8+
- '**.md'
9+
pull_request:
10+
paths-ignore: *paths_ignore
11+
12+
concurrency:
13+
# De-duplicate concurrent workflow runs on the same branch/ref
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
15+
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
516

617
jobs:
718
build:

0 commit comments

Comments
 (0)