Skip to content

ci: skip static analysis for Dependabot and docs/build-only PRs - #4066

Merged
kthoms merged 1 commit into
mainfrom
ci/skip-static-analysis-non-code-prs
Nov 7, 2026
Merged

kthoms merged 1 commit into
mainfrom
ci/skip-static-analysis-non-code-prs

Conversation

@kthoms

@kthoms kthoms commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Skips the Static Code Analysis job in the PR build when it adds no value:

  • PRs authored by Dependabot (any changed files)
  • PRs whose changed files are only documentation or build files: *.md, docs/, .github/, .devenv/, .mvn/, .claude/, package.json / package-lock.json, mvnw, mvnw.cmd, rewrite.yml, .gitignore, LICENSE, NOTICE

Changes to pom.xml by humans still trigger the analysis. If the changed files cannot be determined, the analysis runs.

Changes

  • determine-pr-config computes a new output needs_static_analysis
  • The build job only stages and uploads the sonar-workspace artifact when the analysis will run
  • static-analysis now depends on determine-pr-config and is gated on the new output (fork condition unchanged)

build.yml (push to main/release/*) is unchanged and always runs the analysis.

Verification

  • YAML parses, zizmor reports no findings
  • Decision logic tested under bash: Dependabot poms/npm → skip; human poms → run; docs + workflow → skip; Java source → run; empty diff → run

🤖 Generated with Claude Code

Sonar analysis adds little value for PRs that do not touch analyzable
code. The PR build now skips the Static Code Analysis job, and the
staging/upload of the Sonar workspace, when:

- the PR is authored by Dependabot, or
- all changed files are documentation or build files (*.md, docs/,
  .github/, .devenv/, .mvn/, .claude/, package.json/package-lock.json,
  mvnw, rewrite.yml, .gitignore, LICENSE, NOTICE).

Changes to pom.xml by humans still trigger the analysis. If the changed
files cannot be determined, the analysis runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copilot AI balanced review requested due to automatic review settings November 7, 2026 06:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@github-actions github-actions Bot added the scope:ci Changes to the CI, e.g. GitHub workflows label Nov 7, 2026
@kthoms
kthoms merged commit ff188c8 into main Nov 7, 2026
9 checks passed
@kthoms
kthoms deleted the ci/skip-static-analysis-non-code-prs branch November 7, 2026 06:50
@kthoms kthoms modified the milestones: 2.3.0, 2.2.2 Nov 7, 2026
kthoms added a commit that referenced this pull request Nov 8, 2026
#4066)

Sonar analysis adds little value for PRs that do not touch analyzable
code. The PR build now skips the Static Code Analysis job, and the
staging/upload of the Sonar workspace, when:

- the PR is authored by Dependabot, or
- all changed files are documentation or build files (*.md, docs/,
  .github/, .devenv/, .mvn/, .claude/, package.json/package-lock.json,
  mvnw, rewrite.yml, .gitignore, LICENSE, NOTICE).

Changes to pom.xml by humans still trigger the analysis. If the changed
files cannot be determined, the analysis runs.

Co-authored-by: Claude Opus 5.5 <[email protected]>
(cherry picked from commit ff188c8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:ci Changes to the CI, e.g. GitHub workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants