Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion apps/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function resolveAllComments(context, prNumber) {
)

for (const comment of comments) {
if (comment.user.login !== 'cursor[bot]' || comment.user.login !== 'snyk-io[bot]') continue;
if (comment.user.login !== 'cursor[bot]' && comment.user.login !== 'snyk-io[bot]') continue;
Comment thread
cb-mohitbhatia marked this conversation as resolved.
console.log("deleting comment : " + comment.id);
await context.octokit.request(
'DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}',
Expand Down
15 changes: 12 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async function resolveAllComments(context, prNumber) {
)

for (const comment of comments) {
if (comment.user.login !== 'cursor[bot]' || comment.user.login !== 'snyk-io[bot]') continue;
if (comment.user.login !== 'cursor[bot]' && comment.user.login !== 'snyk-io[bot]') continue;
console.log("deleting comment : " + comment.id);
await context.octokit.request(
'DELETE /repos/{owner}/{repo}/pulls/comments/{comment_id}',
Expand Down Expand Up @@ -193,6 +193,7 @@ exports.masterBranch = masterBranch;
const notifications = __nccwpck_require__(53474);
const github = __nccwpck_require__(76898);
const core = __nccwpck_require__(42186);
const slack = __nccwpck_require__(38154);
const { masterBranch } = __nccwpck_require__(51629);

function toPr(context) {
Expand Down Expand Up @@ -341,8 +342,9 @@ async function raisePrToAllStagingBranches(context, onMergeConflict) {
return createdPr
})
} catch(err) {
console.log("ERROR!")
console.log(err)
slack.autoSyncFailed("master");
throw err;
}
}

Expand Down Expand Up @@ -108038,7 +108040,14 @@ async function notifyPrMergeFailed(pr) {
slack.markdown(`Team <!here>, fix it by merging <${pr.url}|this PR> *manually*.`)
])
}
module.exports = {notifyNewPR, notifyMergedPR, notifyClosedPR, notifyPrHasConflicts, notifyPrMergeFailed}

async function autoSyncFailed(channelName) {
let textMessage = `AUTO SYNC FAILED`
await slack.sendMessage(channelName, textMessage, [
slack.header(":need_action: AUTO SYNC FAILED :need_action:")
])
}
module.exports = {notifyNewPR, notifyMergedPR, notifyClosedPR, notifyPrHasConflicts, notifyPrMergeFailed, autoSyncFailed}

/***/ }),

Expand Down
4 changes: 3 additions & 1 deletion handlers/pr.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const notifications = require("./../notifications/pr");
const github = require("./../apps/github");
const core = require('@actions/core');
const slack = require("../notifications/slack");
const { masterBranch } = require("../constants");

function toPr(context) {
Expand Down Expand Up @@ -149,8 +150,9 @@ async function raisePrToAllStagingBranches(context, onMergeConflict) {
return createdPr
})
} catch(err) {
console.log("ERROR!")
console.log(err)
slack.autoSyncFailed("master");
throw err;
}
}

Expand Down
9 changes: 8 additions & 1 deletion notifications/slack.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,11 @@ async function notifyPrMergeFailed(pr) {
slack.markdown(`Team <!here>, fix it by merging <${pr.url}|this PR> *manually*.`)
])
}
module.exports = {notifyNewPR, notifyMergedPR, notifyClosedPR, notifyPrHasConflicts, notifyPrMergeFailed}

async function autoSyncFailed(channelName) {
let textMessage = `AUTO SYNC FAILED`
await slack.sendMessage(channelName, textMessage, [
slack.header(":need_action: AUTO SYNC FAILED :need_action:")
])
}
module.exports = {notifyNewPR, notifyMergedPR, notifyClosedPR, notifyPrHasConflicts, notifyPrMergeFailed, autoSyncFailed}