Sema Static Analysis in a Java and TypeScript Monorepo Pull Request
Evaluate Sema for CI pull-request gating in Java and TypeScript monorepos, with a GitHub Actions example, severity thresholds, and verification steps.
08 Nov 2026, 07:01 UTC

The Pull Request Bottleneck in a Growing Monorepo
Your Java and TypeScript monorepo has reached the point where pull requests arrive faster than reviewers can inspect them. A reviewer might spot a broken React component, but miss a newly introduced dependency with a known vulnerability or a Java class that bypasses an internal security pattern. Static analysis—automated scanning of source code without running it—can catch these issues earlier, but only if it is integrated into the pull-request workflow instead of run locally and forgotten.
The practical takeaway is to add a code-intelligence tool such as Sema as a continuous integration (CI) gate. Configure it to comment on pull requests, fail builds on high-severity findings, and warn on lower-severity ones. Treat any AI-generated fix suggestion as advisory, not authoritative remediation.
Where Sema Fits in the Review Loop
Sema provides code intelligence that can surface security risks, dependency issues, and code-quality patterns during pull-request review. Integration typically happens through CI providers such as GitHub Actions or GitLab CI, with results posted directly as review comments. Supported languages commonly include Java, TypeScript, Python, and Go, but exact coverage depends on the product tier and release, so verify your stack before committing to a rollout.
In a monorepo, the integration should scan only the changed projects or modules where possible. Scanning the entire repository on every pull request increases runtime and noise, which contributes to alert fatigue.
Example GitHub Actions Configuration
Add a workflow file at .github/workflows/sema.yml. This example is illustrative; replace the scan command with the current vendor command from Sema's documentation, because CLI flags and feature names change between releases.
name: Sema pull-request analysis
on:
pull_request:
branches: [ main ]
permissions:
contents: read
pull-requests: write
jobs:
sema:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Java and TypeScript tooling
run: |
# Install project dependencies required for accurate analysis
./gradlew --version
node --version
- name: Run Sema analysis
env:
SEMA_API_KEY: ${{ secrets.SEM_A_API_KEY }}
run: |
# Replace with the documented Sema command for your tier
sema scan --repo ${{ github.repository }} --pr ${{ github.event.pull_request.number }}
Run this on a GitHub Actions runner. The job needs pull-requests: write permission so it can post comments on the pull request. Store the API key in repository secrets, not in the workflow file. Expected checks are a passing or failing check run on the pull request and review comments referencing specific files and line ranges. A risk is that a misconfigured severity threshold can fail the build on false positives, blocking merges.
Severity Thresholds and Rule Sets
Teams can configure severity thresholds and rule sets to fail builds on high-severity findings while warning on lower-severity issues. A conservative starting policy might look like this:
| Severity | CI action | Reviewer expectation |
|---|---|---|
| High | Fail the build | Must be fixed or explicitly exempted |
| Medium | Warn, but allow merge | Review before next release |
| Low | Informational comment only | Optional cleanup |
Vendor-specific severity names and configuration keys vary. Do not hardcode flags such as --fail-on high without confirming them in the current documentation.
Limitations and Verification Checklist
- AI-generated review suggestions can include false positives and should be treated as advisory.
- Pricing, data retention, and code privacy terms vary by SaaS versus self-hosted deployment. Review the vendor agreement before scanning proprietary or regulated code.
- Supported languages and rule coverage depend on your product tier and release.
Before enabling this on your main repository, run a proof-of-concept in a non-production repository. Open a sample pull request that intentionally includes a known unsafe dependency or pattern, then confirm that Sema posts a comment, maps the severity correctly, and fails or warns the build as expected. Check the vendor changelog for breaking changes after upgrades.
Rollback and Closing Steps
Because adding a workflow file changes repository state, rollback is straightforward: revert the pull request that added .github/workflows/sema.yml and remove the SEMA_API_KEY secret if it is no longer needed.
Start with one monorepo module, use high-severity failures only, and expand the rule set after the team trusts the signal-to-noise ratio. Static analysis should speed up reviews, not replace them.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.