mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-03 03:52:52 +00:00
refactor: omit assigne self reference
This commit is contained in:
@@ -115,6 +115,10 @@ export async function remind(api: Api): Promise<void> {
|
||||
// get possible appropers, prefixed with '@' and joined with commas
|
||||
const possibleApprovers = maintainerUsernames
|
||||
.filter((username) => {
|
||||
if (mergeRequest.assignee.username === username) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (approval.approved_by.length === 0) {
|
||||
return true;
|
||||
}
|
||||
@@ -133,8 +137,8 @@ export async function remind(api: Api): Promise<void> {
|
||||
|
||||
// send message to slack
|
||||
await client.chat.postMessage({
|
||||
channel: SLACK_CHANNEL,
|
||||
text: `Merge request '${mergeRequest.title}' needs more approvals! See ${mergeRequest.web_url}!`,
|
||||
channel: SLACK_CHANNEL,
|
||||
text: `Merge request '${mergeRequest.title}' needs more approvals! See ${mergeRequest.web_url}!`,
|
||||
});
|
||||
|
||||
// create note in merge request
|
||||
@@ -149,12 +153,15 @@ export async function remind(api: Api): Promise<void> {
|
||||
|
||||
// send message to slack
|
||||
await client.chat.postMessage({
|
||||
channel: SLACK_CHANNEL,
|
||||
text: `Merge request '${mergeRequest.title}' is ready to be merged! See ${mergeRequest.web_url}!`,
|
||||
channel: SLACK_CHANNEL,
|
||||
text: `Merge request '${mergeRequest.title}' is ready to be merged! See ${mergeRequest.web_url}!`,
|
||||
});
|
||||
|
||||
// prefix maintainers with '@' and join with commas
|
||||
const possibleMergers = maintainerUsernames
|
||||
.filter((username) => {
|
||||
return mergeRequest.assignee.username !== username;
|
||||
})
|
||||
.map((username) => `@${username}`)
|
||||
.join(', ');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user