Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ module.exports = (app: Probot) => {
}
}
} else {
// Others Approved
if (context.payload.review.state == "approved") {
await context.octokit.pulls.createReview({
repo: context.payload.repository.name,
Expand Down Expand Up @@ -173,7 +174,7 @@ module.exports = (app: Probot) => {
} else {
await context.octokit.issues.addLabels(
context.issue({
labels: ['Approved']
labels: ['Others Approved']
Comment thread
HarunamiYaki marked this conversation as resolved.
})
);
console.log('PRs Approved');
Expand Down Expand Up @@ -222,7 +223,7 @@ module.exports = (app: Probot) => {
await context.octokit.pulls.listReviews({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.pull_request.number,
pull_number: context.payload.pull_request.number
}).then(async (res) => {
const reviewersArray: string[] = [];
const tagReviewers: string[] = [];
Expand Down Expand Up @@ -264,7 +265,7 @@ module.exports = (app: Probot) => {
context.octokit.issues.listLabelsOnIssue({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
issue_number: context.payload.pull_request.number,
issue_number: context.payload.pull_request.number
}).then(async (res) => {
if (res.data.find(a => a.name == "Requested Changes")) {
context.octokit.issues.removeLabel(
Expand Down Expand Up @@ -294,7 +295,7 @@ module.exports = (app: Probot) => {
context.octokit.pulls.get({
owner: context.payload.repository.owner.login,
repo: context.payload.repository.name,
pull_number: context.payload.workflow_run.pull_requests[0].number,
pull_number: context.payload.workflow_run.pull_requests[0].number
}).then(async (res) => {
if (res.data.labels.find(a => a.name == "CI Failed")) {
await context.octokit.issues.removeLabel(
Expand All @@ -309,7 +310,7 @@ module.exports = (app: Probot) => {
} else {
return;
}
})
});
} else if (context.payload.workflow_run.conclusion == "failure") {
console.log('CI Failure!');
await context.octokit.issues.addLabels(
Expand Down