Skip to content

Commit 64468c2

Browse files
authored
ci: skip lint presubmit on non-code changes (#2506)
## Description Optimizes CI usage by skipping `lint` workflows for changes unrelated to source code, such as documentation updates (`docs/**`, `**.md`) or other GitHub configurations (`.github/**`). To satisfy GitHub's **Required Status Checks**, "fallback" workflows have been added. These workflows trigger *only* when the main workflows are skipped and instantly report success, ensuring PRs don't get stuck in a pending state. **Note:** Direct edits to the workflow files themselves are explicitly included in triggers to allow for self-testing. ## PR Checklist > Thank you for opening a Pull Request! Before submitting your PR, there are a > few things you can do to make sure it goes smoothly: - [ ] Make sure you reviewed [CONTRIBUTING.md](https://github.com/googleapis/genai-toolbox/blob/main/CONTRIBUTING.md) - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/genai-toolbox/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) - [ ] Make sure to add `!` if this involve a breaking change 🛠️ Fixes #<issue_number_goes_here>
1 parent 7041e79 commit 64468c2

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

.github/workflows/lint.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,20 @@
1515
name: lint
1616
on:
1717
pull_request:
18+
paths:
19+
- "**"
20+
- "!docs/**"
21+
- "!**.md"
22+
- "!.github/**"
23+
- ".github/workflows/lint.yaml"
1824
pull_request_target:
1925
types: [labeled]
26+
paths:
27+
- "**"
28+
- "!docs/**"
29+
- "!**.md"
30+
- "!.github/**"
31+
- ".github/workflows/lint.yaml"
2032

2133
# Declare default permissions as read only.
2234
permissions: read-all
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
name: lint
16+
17+
on:
18+
pull_request:
19+
paths:
20+
- "docs/**"
21+
- "**.md"
22+
- ".github/**"
23+
- "!.github/workflows/lint.yaml"
24+
pull_request_target:
25+
paths:
26+
- "docs/**"
27+
- "**.md"
28+
- ".github/**"
29+
- "!.github/workflows/lint.yaml"
30+
31+
permissions: read-all
32+
33+
jobs:
34+
lint:
35+
name: lint
36+
runs-on: ubuntu-latest
37+
steps:
38+
- name: Skip Lint
39+
run: |
40+
echo "Skipping lint for documentation/config-only changes."
41+
echo "This job exists to satisfy the required status check."

0 commit comments

Comments
 (0)