Skip to content

Commit

Permalink
PR Comment workflow update
Browse files Browse the repository at this point in the history
  • Loading branch information
theballaam96 committed Feb 26, 2024
1 parent c032711 commit d89c266
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/scripts/pr-comment-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@ async function run() {
userID = existingData[user]
}
}
let content = null;
let webhookUrl = null;
if (user == commentUser) {
// User probably doesn't want to be notified of their own comment
return;
// Post to verification team
content = `New PR Comment from Converter: ${process.env.PR_URL}`
webhookUrl = process.env.DISCORD_WEBHOOK_SUBMISSION;
} else {
// Post to submission comments channel
let mention = userID == null ? "" : `<@${userID}> `
content = `${mention}New PR Comment: ${process.env.PR_URL}`;
webhookUrl = process.env.DISCORD_WEBHOOK_PRCOMMENT;
}
let mention = userID == null ? "" : `<@${userID}> `
let content = `${mention}New PR Comment: ${process.env.PR_URL}`;
const webhookUrl = process.env.DISCORD_WEBHOOK_PRCOMMENT;
const options = {
method: "POST",
url: webhookUrl,
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/new-pr-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_URL: ${{ github.event.issue.html_url }}
DISCORD_WEBHOOK_PRCOMMENT: ${{ secrets.DISCORD_WEBHOOK_PRCOMMENT }}
DISCORD_WEBHOOK_SUBMISSION: ${{ secrets.DISCORD_WEBHOOK_SUBMISSIONS }}
COMMENT_USER: ${{ github.event.comment.user.login }}

0 comments on commit d89c266

Please sign in to comment.