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
console.log("No repo data found, skipping processing...");
47
+
returnsecretsDetected;
48
+
}
49
+
50
+
constcommentBody=`🚨 Secret Detected 🚨\nSecret detected at line ${jsonData.SourceMetadata.Data.Git.line} in file ${jsonData.SourceMetadata.Data.Git.file}. Please review.`;
51
+
52
+
constprs=awaitoctokit.pulls.list({
53
+
owner: repoData.owner,
54
+
repo: repoData.repo,
55
+
});
56
+
57
+
for(constprofprs.data){
58
+
if(pr.state==="open"){
59
+
constcommitId=awaitoctokit.repos.getCommit({
60
+
owner: repoData.owner,
61
+
repo: repoData.repo,
62
+
ref: pr.head.sha,
63
+
});
64
+
65
+
awaitoctokit.pulls.createReviewComment({
66
+
owner: repoData.owner,
67
+
repo: repoData.repo,
68
+
pull_number: pr.number,
69
+
body: commentBody,
70
+
commit_id: commitId.data.sha,
71
+
path: jsonData.SourceMetadata.Data.Git.file,
72
+
line: jsonData.SourceMetadata.Data.Git.line,
73
+
side: "RIGHT",// assuming the secret was added, not removed
console.log("No repo data found, skipping processing...");
93
-
return;
94
-
}
95
-
96
-
constcommentBody=`🚨 Secret Detected 🚨\nSecret detected at line ${jsonData.SourceMetadata.Data.Git.line} in file ${jsonData.SourceMetadata.Data.Git.file}. Please review.`;
97
-
98
-
try{
99
-
constprs=awaitoctokit.pulls.list({
100
-
owner: repoData.owner,
101
-
repo: repoData.repo,
102
-
});
103
-
104
-
for(constprofprs.data){
105
-
if(pr.state==="open"){
106
-
constcommitId=awaitoctokit.repos.getCommit({
107
-
owner: repoData.owner,
108
-
repo: repoData.repo,
109
-
ref: pr.head.sha,
110
-
});
111
-
112
-
awaitoctokit.pulls.createReviewComment({
113
-
owner: repoData.owner,
114
-
repo: repoData.repo,
115
-
pull_number: pr.number,
116
-
body: commentBody,
117
-
commit_id: commitId.data.sha,
118
-
path: jsonData.SourceMetadata.Data.Git.file,
119
-
line: jsonData.SourceMetadata.Data.Git.line,
120
-
side: "RIGHT",// assuming the secret was added, not removed
0 commit comments