ci: skip expensive jobs for docs-only changes#369
Conversation
8f93487 to
83a488d
Compare
Greptile SummaryThis PR replaces per-workflow
Confidence Score: 4/5Safe to merge — the change only affects when expensive CI jobs run, not how the project is built or tested. The logic is sound: the script correctly handles shallow clones, zero SHAs, and both push/PR event contexts. The only issue is a pair of unreachable .github/scripts/detect-code-changes.sh has the redundant case patterns; all three workflow files look correct. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Push to main / PR opened] --> B[changes job\ndetect-code-changes.sh]
B --> C{code_changed?}
C -- false\ndocs/assets/LICENSE only --> D[All expensive jobs SKIPPED]
C -- true\ncode files touched --> E[validate / pr-validate]
C -- true --> F[tty-smoke]
C -- true --> G[pack-npm / prebuilt-npm]
C -- true --> H[build-bin]
C -- true --> I[windows-compat]
C -- true --> J[Nix package]
subgraph detect-code-changes.sh
K[resolve zero base SHA → empty tree] --> L[fetch missing SHAs\nif shallow clone]
L --> M[git diff --name-only\nbase..head]
M --> N{any non-docs path?}
N -- yes --> O[code_changed=true]
N -- no --> P[code_changed=false]
end
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
.github/scripts/detect-code-changes.sh:22
In bash `case` patterns, `*` matches any character sequence **including** `/`, so `docs/*` already matches `docs/subfolder/file.png` and any deeper path. The `docs/**` and `assets/**` alternatives are therefore dead branches — they can never be reached because `docs/*` always matches first and exits the case block. The same applies to `assets/**` following `assets/*`.
```suggestion
*.md | docs/* | assets/* | LICENSE)
```
Reviews (1): Last reviewed commit: "ci: skip expensive jobs for docs-only ch..." | Re-trigger Greptile |
| local path="$1" | ||
|
|
||
| case "$path" in | ||
| *.md | docs/* | docs/** | assets/* | assets/** | LICENSE) |
There was a problem hiding this comment.
In bash
case patterns, * matches any character sequence including /, so docs/* already matches docs/subfolder/file.png and any deeper path. The docs/** and assets/** alternatives are therefore dead branches — they can never be reached because docs/* always matches first and exits the case block. The same applies to assets/** following assets/*.
| *.md | docs/* | docs/** | assets/* | assets/** | LICENSE) | |
| *.md | docs/* | assets/* | LICENSE) |
Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/scripts/detect-code-changes.sh
Line: 22
Comment:
In bash `case` patterns, `*` matches any character sequence **including** `/`, so `docs/*` already matches `docs/subfolder/file.png` and any deeper path. The `docs/**` and `assets/**` alternatives are therefore dead branches — they can never be reached because `docs/*` always matches first and exits the case block. The same applies to `assets/**` following `assets/*`.
```suggestion
*.md | docs/* | assets/* | LICENSE)
```
How can I resolve this? If you propose a fix, please make it concise.There was a problem hiding this comment.
Good catch — simplified the Bash case pattern to remove the unreachable docs/** / assets/** alternatives while preserving recursive matching via docs/* and assets/*.
This comment was generated by Pi using OpenAI GPT-5
83a488d to
8d9f9cb
Compare
Summary
Testing
This PR description was generated by Pi using OpenAI GPT-5