lukaszlenart opened a new pull request, #1846: URL: https://github.com/apache/struts/pull/1846
Editing an agent skill under `.claude/` rebuilt the whole project on GitHub Actions and Jenkins. No code changed, so every one of those runs was wasted. ### The trap this has to avoid `.asf.yaml` makes **`Build and Test (JDK 17)`** a required status check on `main` (and `Build and Test (8)` on `support/struts-6-x-x`). GitHub documents that a workflow skipped by path filtering never reports its checks — they stay *Pending*, and "a pull request that requires those checks to be successful will be blocked from merging." So a plain `paths-ignore` on `maven.yml`'s `pull_request` trigger would make every docs-only PR permanently unmergeable. A job skipped by an `if:` condition is different: it does report, as `skipped`, and required checks accept "`successful`, `skipped`, or `neutral`". ### What changed | File | Approach | |---|---| | `codeql.yml`, `owasp.yml`, `sonar.yml` | `paths-ignore` on both `push` and `pull_request` — none of their checks are required, so a run that never happens blocks nothing | | `maven.yml` | `paths-ignore` on `push` only; on `pull_request` a small `changes` job reads the PR's file list and the build job carries `if: needs.changes.outputs.code == 'true'` | | `Jenkinsfile` | `pollSCM` can't be path-filtered, so the two JDK stages are guarded by a `Detect changes` stage instead | Jenkins detection **fails open**: no previous successful commit, an unreachable commit, or any git error reports `true` and the build runs exactly as before. ### One thing worth knowing The filter tests for a non-empty list of files outside `.claude/` rather than using `grep -qv`. While testing I hit **ugrep 7.5.0** (installed locally as `grep`) returning 1 from `-qv` on input where `-cv` counts 1 and `-v` prints the line — which silently inverts the decision and would have skipped builds for real code changes. GNU grep on the runners wouldn't do that, but testing emptiness behaves the same everywhere. Exercised against six inputs: `.claude/`-only (skip), mixed `.claude/` + code (**build**), empty (skip), `.claudefoo/` (build — must not be treated as `.claude/`), code-only (build), nested `.claude/.../scripts/*.sh` (skip). ### Not verified yet This PR itself touches `.github/` and `Jenkinsfile`, so it exercises the *build* path, not the skip path. The skip path is first proven by the next `.claude/`-only PR — #1844 is one, once this merges. If the required check somehow fails to report there, the fallback is to drop the `if:` from `maven.yml` and keep the `push` filter. Only the 7.x line is changed here; `support/struts-6-x-x` needs the same edit on its own branch. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
