Skip to content

Commit 0666566

Browse files
authored
PDP-684: Update the existing pull request comment if secrets are resolved. (#18)
* PDP-684: updated the workflow for updating the pullrequest comment * PDP-684: Updated to update the comment
1 parent f610f23 commit 0666566

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

.github/workflows/trufflehog-scan.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,8 @@ jobs:
176176
if (!hasSecrets) {
177177
// No secrets found
178178
if (existing) {
179-
// Check if existing comment was a critical/blocking one (had verified secrets)
180-
const wasBlocking = existing.body.includes('CRITICAL') || existing.body.includes(':rotating_light:');
181-
if (wasBlocking) {
182-
// Update to show verified secrets are now resolved
183-
body = `${commentMarker}
179+
// Update existing comment to show secrets are now resolved
180+
body = `${commentMarker}
184181
## :white_check_mark: Secret Scanning Passed
185182
186183
**No secrets detected in this pull request.**
@@ -192,14 +189,12 @@ jobs:
192189
---
193190
*This comment will be updated if new secrets are detected in future commits.*
194191
`;
195-
await github.rest.issues.updateComment({
196-
owner: context.repo.owner,
197-
repo: context.repo.repo,
198-
comment_id: existing.id,
199-
body: body
200-
});
201-
}
202-
// If it was just a warning (unverified only), leave it as-is
192+
await github.rest.issues.updateComment({
193+
owner: context.repo.owner,
194+
repo: context.repo.repo,
195+
comment_id: existing.id,
196+
body: body
197+
});
203198
}
204199
// If no existing comment and no secrets, don't post anything
205200
return;

0 commit comments

Comments
 (0)