Skip to content

Commit

Permalink
CI: When only Hugo docs change, other workflows do not need to run (x…
Browse files Browse the repository at this point in the history
…api-project#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.
  • Loading branch information
psafont authored Jan 29, 2025
2 parents 03e82b6 + 3a6a64e commit 08f8647
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: Build and test

on:
# When only Hugo docs change, this workflow is not required:
push:
paths-ignore:
- 'doc/**'
- '.github/workflows/hugo.yml'
pull_request:
paths-ignore:
- 'doc/**'
- '.github/workflows/hugo.yml'
schedule:
# run daily, this refreshes the cache
- cron: "13 2 * * *"
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/other.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
name: Build and test (other)

on:
# When only Hugo docs change, this workflow is not required:
push:
paths-ignore:
- 'doc/**'
- '.github/workflows/hugo.yml'
pull_request:
paths-ignore:
- 'doc/**'
- '.github/workflows/hugo.yml'
schedule:
# run daily, this refreshes the cache
- cron: "13 2 * * *"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/shellcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: ShellCheck

on:
pull_request:
# When only Hugo docs change, this workflow is not required:
paths-ignore:
- 'doc/**'
- '.github/workflows/hugo.yml'
merge_group:

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

0 comments on commit 08f8647

Please sign in to comment.