Skip to content

Commit 08f8647

Browse files
authored
CI: When only Hugo docs change, other workflows do not need to run (#6254)
Optional improvement for fast CI completion when only Hugo docs change on push/PRs: When only Hugo docs change on push and PRs, other workflows can be skipped using `paths-ignore:` for `docs/**` and `.github/workflows/hugo.yml` to not trigger other workflows if only these paths change when pushing to a branch / work on a PR. This is completely optional, but would be nice to have when only working on Hugo docs. It does not change scheduled CI runs. It changes only on-demand push/PR workflow runs.
2 parents 03e82b6 + 3a6a64e commit 08f8647

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
name: Build and test
22

33
on:
4+
# When only Hugo docs change, this workflow is not required:
45
push:
6+
paths-ignore:
7+
- 'doc/**'
8+
- '.github/workflows/hugo.yml'
59
pull_request:
10+
paths-ignore:
11+
- 'doc/**'
12+
- '.github/workflows/hugo.yml'
613
schedule:
714
# run daily, this refreshes the cache
815
- cron: "13 2 * * *"

.github/workflows/other.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
name: Build and test (other)
22

33
on:
4+
# When only Hugo docs change, this workflow is not required:
45
push:
6+
paths-ignore:
7+
- 'doc/**'
8+
- '.github/workflows/hugo.yml'
59
pull_request:
10+
paths-ignore:
11+
- 'doc/**'
12+
- '.github/workflows/hugo.yml'
613
schedule:
714
# run daily, this refreshes the cache
815
- cron: "13 2 * * *"

.github/workflows/shellcheck.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ name: ShellCheck
22

33
on:
44
pull_request:
5+
# When only Hugo docs change, this workflow is not required:
6+
paths-ignore:
7+
- 'doc/**'
8+
- '.github/workflows/hugo.yml'
59
merge_group:
610

711
concurrency: # On new push, cancel old workflows from the same PR, branch or tag:

0 commit comments

Comments
 (0)