Skip to content

ci: harden CI pipeline for external/fork PRs (GTI-846)#27

Merged
sagile merged 4 commits into
mainfrom
GTI-846-harden-ci-pipeline
Jun 4, 2026
Merged

ci: harden CI pipeline for external/fork PRs (GTI-846)#27
sagile merged 4 commits into
mainfrom
GTI-846-harden-ci-pipeline

Conversation

@sagile

@sagile sagile commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • permissions: contents: read on build.yml — explicit least-privilege for fork PR runs; no secrets are accessible to untrusted code
  • Concurrency groups on build.yml, early-access.yml, and release.yml — superseded runs are cancelled automatically (cancel-in-progress: false on release to avoid mid-publish interruption)
  • SHA-pinned all third-party actions — replaces mutable @v4 / @v2 tags with immutable commit SHAs across all four workflows; a compromised tag can no longer silently swap action code
  • Removed styfle/cancel-workflow-action in early-access.yml and release.yml — replaced with native concurrency blocks; eliminates an extra third-party dependency and the PAT it required
  • jreleaser/release-action pinned to 2.5.0 tag SHA (90ac653) instead of the mutable v2 branch ref

Acceptance criteria (GTI-846)

  • Fork PRs build & test safely with no secret access
  • Workflow permissions are least-privilege
  • All third-party actions are SHA-pinned
  • Concurrency groups cancel superseded runs

Manual step required (cannot be done via YAML)

Enable Settings → Actions → General → Fork pull request workflows → "Require approval for first-time contributors" to gate workflow runs from first-time external contributors behind maintainer approval.

🤖 Generated with Claude Code


Note

Medium Risk
PR validation scope changed from full build to explicit Gradle targets, so coverage gaps are possible if modules were previously picked up only by the monolithic task.

Overview
Hardens GitHub Actions for fork/untrusted PRs and supply-chain risk: build.yml now declares least-privilege permissions (contents: read, actions: write for artifacts), concurrency that cancels superseded PR runs, and commit-SHA–pinned third-party actions instead of mutable @v4/@v2 tags.

The PR build is no longer one ./gradlew build job—it’s split into style (Spotless), compile (assemble), test (after compile: :core:test plus demo VCR modules), and spotbugs in parallel after compile; failed-test artifact paths point at those module report dirs.

early-access.yml and release.yml drop styfle/cancel-workflow-action (and its PAT) in favor of native concurrency; release keeps cancel-in-progress: false so publishes aren’t interrupted. docs.yml (and release/early-access) get the same SHA pinning; JReleaser is pinned to the 2.5.0 action SHA.

Maintainers still need the repo setting to require approval for first-time contributors on fork workflows—that’s called out as outside YAML.

Reviewed by Cursor Bugbot for commit e0b57ae. Bugbot is set up for automated code reviews on this repo. Configure here.

- Add least-privilege permissions (contents: read) to build.yml
- Add concurrency groups to cancel superseded runs in build, early-access, and release workflows
- Pin all third-party actions to immutable commit SHAs
- Remove styfle/cancel-workflow-action in favour of native concurrency blocks
- Use jreleaser/release-action 2.5.0 tag SHA instead of mutable v2 branch ref

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jit-ci

jit-ci Bot commented Jun 3, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Comment thread .github/workflows/build.yml
Comment thread .github/workflows/release.yml Outdated
sagile and others added 2 commits June 3, 2026 16:56
- Add actions: write to build, early-access, and release workflows so
  actions/upload-artifact can write artifacts when permissions are explicit
- Pin jreleaser/release-action to 2.5.0 tag SHA (90ac653) in release.yml,
  matching early-access.yml (was still pointing at mutable v2 branch ref)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- style: spotlessCheck only — fast (~30s), no Docker, runs independently
- compile: assemble only — fast fail gate before heavier jobs
- test: :core:test — unit tests (testcontainers/Redis), gated on compile
- spotbugs: :core:spotbugsMain — static analysis, runs in parallel with test

Mirrors the multi-job structure already used in redis-om-spring.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7fc85a4. Configure here.

Comment thread .github/workflows/build.yml Outdated
langchain4j-vcr and spring-ai-vcr tests use PLAYBACK mode with pre-recorded
cassettes — no API key needed, safe to run in CI. rag-multimodal tests are
excluded as they require live API keys (OpenAI, LangCache etc).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sagile sagile merged commit 887d04f into main Jun 4, 2026
6 checks passed
@sagile sagile deleted the GTI-846-harden-ci-pipeline branch June 4, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant