mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
only send risk notif when risks are found
This commit is contained in:
@@ -129,16 +129,18 @@ export default async (app: Probot) => {
|
|||||||
const adminOrOwnerEmails = userEmails.map(userObject => userObject.email)
|
const adminOrOwnerEmails = userEmails.map(userObject => userObject.email)
|
||||||
|
|
||||||
const usersToNotify = pusher?.email ? [pusher.email, ...adminOrOwnerEmails] : [...adminOrOwnerEmails]
|
const usersToNotify = pusher?.email ? [pusher.email, ...adminOrOwnerEmails] : [...adminOrOwnerEmails]
|
||||||
await sendMail({
|
if (Object.keys(allFindingsByFingerprint).length) {
|
||||||
template: "secretLeakIncident.handlebars",
|
await sendMail({
|
||||||
subjectLine: `Incident alert: leaked secrets found in Github repository ${repository.full_name}`,
|
template: "secretLeakIncident.handlebars",
|
||||||
recipients: usersToNotify,
|
subjectLine: `Incident alert: leaked secrets found in Github repository ${repository.full_name}`,
|
||||||
substitutions: {
|
recipients: usersToNotify,
|
||||||
numberOfSecrets: Object.keys(allFindingsByFingerprint).length,
|
substitutions: {
|
||||||
pusher_email: pusher.email,
|
numberOfSecrets: Object.keys(allFindingsByFingerprint).length,
|
||||||
pusher_name: pusher.name
|
pusher_email: pusher.email,
|
||||||
}
|
pusher_name: pusher.name
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const postHogClient = await TelemetryService.getPostHogClient();
|
const postHogClient = await TelemetryService.getPostHogClient();
|
||||||
if (postHogClient) {
|
if (postHogClient) {
|
||||||
|
|||||||
Reference in New Issue
Block a user