parent
c85c61ed95
commit
726961ca99
|
|
@ -5,6 +5,11 @@ import { ChannelType } from "discord.js"
|
|||
import { assertNever } from "@workshop/shared/utils"
|
||||
|
||||
export const handleGiteaWebhook = async (payload: GiteaWebhook) => {
|
||||
const isDev = process.env.NODE_ENV !== "production"
|
||||
if (!isDev && payload.repository.name === "🧪") {
|
||||
return
|
||||
}
|
||||
|
||||
if ("pull_request" in payload) {
|
||||
if (payload.action === "opened") {
|
||||
await handlePullRequestOpened(payload)
|
||||
|
|
@ -143,7 +148,6 @@ ${pullRequest.html_url}
|
|||
|
||||
const formatComment = async (comment: { body: string; user: GiteaUser }): Promise<string> => {
|
||||
const authorName = mapGiteaUserToDiscord(comment.user.login)
|
||||
console.log(`🌭`, { authorName, comment: comment.user.login })
|
||||
const messageBody = await convertMentionsToDiscord(comment.body)
|
||||
|
||||
return `**${authorName}**: ${messageBody}`
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user