Skip to content

S-125938: Add gitleaks secret scanning - #2

Merged
EllAchE merged 1 commit into
mainfrom
s-125938-gitleaks-husky-20260721
Jul 23, 2026
Merged

S-125938: Add gitleaks secret scanning#2
EllAchE merged 1 commit into
mainfrom
s-125938-gitleaks-husky-20260721

Conversation

@EllAchE

@EllAchE EllAchE commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a pinned Gitleaks workflow and default configuration so pull requests and default-branch pushes receive secret scanning.
  • Load scanner configuration from the base branch during pull-request scans, preventing the change under review from weakening its own check.

Test plan

  • Validate the workflow with Prettier
  • Review the gitleaks configuration and workflow diff

Part of S-125938

Agent Audit

  • Action: create-pr
  • Timestamp: 2026-07-21T20:18:16Z
  • Agent: codex
  • Agent type: codex
  • Triggered by: loganharless
  • Origin: loganharless@dev-vm
  • Session: 019f8643-2ab0-7112-99cd-19471a75612b
  • Source repo: usestring/.usestring
  • Worktree: /home/loganharless/worktrees/s-125938-usestring-repos/.usestring
  • Branch: s-125938-gitleaks-husky-20260721
  • Head commit: e3fad83
  • tmux pane: %8
  • tmux session: cdx-3124802-79

@EllAchE EllAchE added the codex PR primarily authored by Codex label Jul 21, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e3fad83654

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

HEAD_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
if ! git cat-file -e "$BASE_SHA^{commit}" 2>/dev/null; then
BASE_SHA="$HEAD_SHA~1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid falling back to scanning only the last pushed commit

When BASE_SHA is not present in the checkout, such as a created/recreated main branch or a force-push whose old tip is no longer fetched, this fallback narrows the scan to HEAD_SHA~1..HEAD_SHA. The next command passes that range to Gitleaks via --log-opts, so any secret introduced in earlier commits from the same pushed update is never examined; for a secret scanner, it is safer to fetch the missing base, scan the full reachable history for that push, or fail closed instead of scanning only one commit.

Useful? React with 👍 / 👎.

@EllAchE
EllAchE merged commit f3a2865 into main Jul 23, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex PR primarily authored by Codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant