-
Notifications
You must be signed in to change notification settings - Fork 0
/
file.js
25 lines (19 loc) · 825 Bytes
/
file.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
async function handlePullRequest(context) {
setStatus(context, "pending", "Running analysys")
.then(
const { title, html_url: htmlUrl, head } = context.payload.pull_request;
let workingDirectory = helper.getWorkingDirectory(head.sha);
helper.runGit(context.payload.pull_request.head.repo.full_name, context.payload.pull_request.head.ref, workingDirectory);
let errors = helper.runAnalysis(workingDirectory);
helper.deleteWorkingDirectory(workingDirectory);
if(errors){
const status = "error";
setStatus(context, status, "There are some errors");
}
else{
const status = "success";
setStatus(context, status, "Check is now completed");
}
}
)
}