Skip to content

fix(ci): stop Core main secret scans at the pushed commit - #4828

Merged
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-4827
Aug 11, 2026
Merged

fix(ci): stop Core main secret scans at the pushed commit#4828
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-4827

Conversation

@chet

@chet chet commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

On normal Core main pushes, we already gave TruffleHog github.event.before as the base but left head empty. TruffleHog treats that as an open-ended git log --all, so it can scan commits from unrelated fetched refs and still report green. This adds the missing GITHUB_SHA head so the check stops at the commit that actually landed; pull request, tag, and REST behavior stay unchanged.

  • Expected green-run effect: No meaningful full-pipeline savings are expected. This should reduce the scanner's input, but startup time dominates the observed scan duration.
  • What it really buys us: A green Core main scan is bounded to the exact push we meant to verify.

Related issues

This supports #4827

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Additional Notes

The changed branch runs only after a push lands on main, so the post-merge Core secret-scan job is the end-to-end check. It should log github.event.before as base, the exact pushed GITHUB_SHA as head, nonzero scan work, and no source errors.

Closes #4827

On normal `main` pushes, we already supplied `github.event.before` as the TruffleHog base, but left `head` empty. That makes TruffleHog scan every fetched ref after the base instead of stopping at the commit that just landed.

So, pass `GITHUB_SHA` as the head beside the existing base. Pull request, release-tag, and REST paths are unchanged.

- **Expected green-run effect:** No meaningful full-pipeline savings are expected; this should reduce scanner input, but startup time dominates the observed scan duration.
- **What it really buys us:** A green Core `main` scan is bounded to the exact push we meant to verify.

This supports NVIDIA#4827

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
@chet
chet requested a review from a team as a code owner August 11, 2026 18:10
@chet

chet commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Summary by CodeRabbit

  • Bug Fixes
    • Improved secret scanning for standard branch pushes by ensuring the correct commit is included in the scan range.

Walkthrough

The CI workflow now sets the secret-scan range head to GITHUB_SHA for ordinary branch pushes.

Changes

Secret scan range resolution

Layer / File(s) Summary
Set branch push scan head
.github/workflows/ci.yaml
The ordinary push scan range now uses GITHUB_SHA as its head commit.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Possibly related issues

Possibly related PRs

Suggested labels: infra

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the CI fix and the exact scan boundary change for Core main.
Description check ✅ Passed The description directly explains the secret-scan bug, the fix, expected effects, preserved behavior, and manual testing.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@chet: I will perform a complete review of PR #4828.

🐇

✅ Action performed

Full review finished.

@nv-dmendoza nv-dmendoza left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@chet
chet merged commit 8f3cff1 into NVIDIA:main Aug 11, 2026
66 checks passed
@chet
chet deleted the gh-issue-4827 branch August 11, 2026 20:03
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.

Bound Core Main Secret Scans to the Pushed Commit

2 participants