Skip to content

Commit

Permalink
better logging
Browse files Browse the repository at this point in the history
Signed-off-by: lucasew <[email protected]>
  • Loading branch information
lucasew committed Dec 20, 2024
1 parent 759b316 commit 0425d3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/routes/api/callback/+server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ export async function POST(event) {
const { id, name, status, conclusion, html_url } = workflow_run
const prData = name.match('#([0-9]*)')
if (!prData) {
console.error({error: "Can't detect PR number", data: methods.data})
console.error({message: "Can't detect PR number", data: methods.data})
return genericOK
}
const pr = prData[1]
const triggerData = name.match('for (.*)')
if (!triggerData) {
console.error({error: "Can't detect trigger owner", data: methods.data})
console.error({message: "Can't detect trigger owner", data: methods.data})
return genericOK
}
const triggerUser = triggerData[1]
const triggerChatID = Object.keys(users).find(k => users[k] === String(triggerUser))
console.log({triggerChatID, triggerData})
if (!triggerChatID) {
console.error({error: "Can't detect trigger owner", data: methods.data})
console.error({message: "Can't detect trigger owner", data: methods.data})
return genericOK
}
const emoji = workflowEmoji(selectedWorkflow)
Expand Down

0 comments on commit 0425d3f

Please sign in to comment.