You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update TruffleHog workflow to handle resolved secrets
Adds a workflow step to update the PR comment when previously detected secrets are resolved, marking the PR as clear. Updates documentation to clarify that exclusion patterns are additive, describes the new comment update behavior, and improves the remediation and PR comment sections for clarity.
This completely replaces org-level patterns for that repository.
98
+
**Exclusions are additive:** Your patterns are combined with the default exclusions. You don't need to repeat common patterns like `node_modules/` or `.lock` files.
99
99
100
100
## Default Exclusions
101
101
@@ -166,15 +166,22 @@ Determine PR Type
166
166
Secrets found No secrets found
167
167
| |
168
168
v v
169
-
Post PR comment Set commit status
170
-
with findings to success
171
-
| |
172
-
v v
173
-
Set commit status PASS - PR allowed
174
-
to failure
175
-
|
176
-
v
177
-
FAIL - PR blocked
169
+
Post/Update PR Check for previous
170
+
comment with alert comment
171
+
findings |
172
+
| +--------+--------+
173
+
| | |
174
+
v v v
175
+
Set commit status Exists? No comment
176
+
to failure | (clean PR)
177
+
| v |
178
+
v Update to v
179
+
FAIL - PR "Resolved" Set commit status
180
+
blocked status to success
181
+
| |
182
+
v v
183
+
Set commit PASS - PR allowed
184
+
to success
178
185
```
179
186
180
187
**Scan scope:** Only files modified in the PR are scanned, not the entire repository.
@@ -190,12 +197,27 @@ TruffleHog classifies detected secrets into two categories:
190
197
191
198
## PR Comments
192
199
193
-
When secrets are detected, the workflow automatically posts a comment on the PR with:
200
+
The workflow manages PR comments to provide clear feedback throughout the remediation process:
201
+
202
+
### When Secrets Are Detected
203
+
204
+
A comment is posted with:
205
+
- Commit SHA that was scanned
206
+
- Timestamp of the scan
194
207
- Link to workflow logs for detailed findings
195
208
- Instructions for removing and rotating secrets
196
209
- Information about file paths, line numbers, and secret types
197
210
198
-
When no secrets are found, no comment is posted to keep the PR clean.
211
+
### When Secrets Are Resolved
212
+
213
+
If you fix the secrets and push again:
214
+
- The **same comment is updated** to show a "Passed" status
215
+
- Shows the new commit SHA that resolved the issue
216
+
- Includes a reminder to rotate any previously exposed credentials
217
+
218
+
### Clean PRs
219
+
220
+
If a PR never had secrets detected, no comment is posted to keep the PR clean.
199
221
200
222
## Workflow Triggers
201
223
@@ -240,8 +262,9 @@ If the scan fails:
240
262
2.**Rotate the secret** immediately (assume it's compromised)
241
263
3.**Push the fix** to your PR branch
242
264
4. Scan re-runs automatically
265
+
5. PR comment updates to show "Resolved" status when fixed
243
266
244
-
**For false positives:** Add the file/pattern to repo-level `TRUFFLEHOG_EXCLUDES`or request an update to org-level patterns.
267
+
**For false positives:** Add the file/pattern to repo-level `TRUFFLEHOG_EXCLUDES`(patterns are additive to defaults).
0 commit comments