Skip to content

ci: skip running builds and tests if no code changed #8768

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: ci

on: [pull_request] # yamllint disable-line rule:truthy
on:
pull_request:
paths-ignore:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation for the paths-ignore configuration is here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good start I think

- 'docs/**' # If the PR only modifies the documentation, there is no need to run builds and code tests
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another option here which which would reduce the runs even more would be to instead use '**.md, since that would include things like README.md or roadmap.md. However I am not sure if that is too liberal a policy. There are a number of other markdown files in the repo for which changes may warrant running tests for reasons I am not privy to.

$ find . -name '*md' | rg -v ./vendor | rg -v ./docs
./.github/ISSUE_TEMPLATE/feature-request.md
./.github/ISSUE_TEMPLATE/free-form.md
./.github/ISSUE_TEMPLATE/promotion-request.md
./.github/ISSUE_TEMPLATE/bug-report.md
./.github/pull_request_template.md
./cmd
./cmd/entrypoint/README.md
./cmd/nop/README.md
./code-of-conduct.md
./examples/README.md
./hack/README.md
./tekton/README.md
./tekton/release-cheat-sheet.md
./test/custom-task-ctrls/wait-task-beta/README.md
./test/custom-task-ctrls/wait-task-beta/cmd
./test/resolver-with-timeout/README.md
./test/README.md
./topical-ownership.md
./CONTRIBUTING.md
./api_compatibility_policy.md
./roadmap.md
./DEVELOPMENT.md
./README.md
./releases.md

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think **md should be ok but depends on if any of the tests are testing the md files as you mentioned. Once we know that for sure we can use **md. +1 for the current defensive approach.


concurrency:
group: ${{ github.workflow }}-${{ github.event.pull-request.number || github.ref }}
Expand Down
Loading