Skip to content

Security: fail CI when a commit adds a secret - #15

Merged
screen-gd merged 1 commit into
mainfrom
security/secret-scanning
Oct 22, 2026
Merged

screen-gd merged 1 commit into
mainfrom
security/secret-scanning

Conversation

@screen-gd

@screen-gd screen-gd commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Bottom of the stack: #15 → #16 → #17

Merge order: #15, then #16, then #17. delete_branch_on_merge is off, so click Delete branch after each merge; that makes GitHub retarget the next PR to main.

Summary

Adds a CI check that fails when a pull request or a push to main adds a secret. A Google API key reached .env.example in 04f8ab5 and was only removed by hand in the next commit.

+.github/workflows/secret-scan.yml   # gitleaks 8.30.1 (sha256-checked) on the new commits only
+.gitleaks.toml                      # built-in rules + comfy-api-key, .agents/ allowlisted
on pull_request | push to main
  checkout (full history)
  gitleaks git --log-opts "<base>..<head>" --redact
    fail on any finding

.agents/ is allowlisted because the vendored skill docs use sample tokens in their examples (11 findings in 2002dfe, all docs).

Evidence

  • Before: nothing checks commits. 04f8ab5 added a live-format Google key to .env.example.
    After: this config reports gcp-api-key .env.example@04f8ab5 on that commit, and the scan exits 1.
  • Full history of main with this config: one finding, the same revoked key.
  • This PR's own commit range: no leaks found, exit 0.
  • The key itself was revoked. The Gemini API rejects it with API_KEY_INVALID.

Merge Danger

Door: two-way

Blast Radius: CI

New PRs fail if they add a key-shaped string. A false positive can be allowlisted in .gitleaks.toml.

Summary by CodeRabbit

  • Chores
    • Added automated secret scanning for pull requests and pushes to the main branch, helping catch exposed credentials before changes are merged.
    • Scanning now recognizes an additional credential-like token pattern and excludes specified agent-related paths.

A Comfy API key and a Google API key were both committed to .env.example
in the past. GitHub push protection did not stop the Comfy key because it
does not know that format.

The new workflow runs gitleaks 8.30.1 (checksum-verified) on the commits
each pull request or push to main adds. .gitleaks.toml extends the
built-in rules with a comfy-api-key rule and allowlists files whose
contents only look like credentials.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d4a0225e-9bbc-4d20-84b0-383995e5d9b2
📥 Commits

Reviewing files that changed from the base of the PR and between 077dcb2 and d1556fe.

📒 Files selected for processing: 2
  • .github/workflows/secret-scan.yml
  • .gitleaks.toml
+--------------------------------------------+
| `undefined` is not a business requirement. |
+--------------------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@screen-gd
screen-gd added this pull request to stack #18 October 22, 2026 23:22
@screen-gd
screen-gd merged commit 2696d81 into main Oct 22, 2026
1 of 2 checks passed
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