Skip to content
Merged
Changes from all 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
29 changes: 22 additions & 7 deletions .github/workflows/feedback-prompt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,32 @@ jobs:
with:
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
script: |
// Get PR author username
const pr = context.payload.pull_request;
const prAuthor = pr.user.login;
const assignees = (pr.assignees ?? [])
.filter(a => a.login.toLowerCase() !== "copilot")
.map(a => "@" + a.login)
.join(" ");

// Compose the comment body as a plain text message to post on the PR
const commentBody =
"👋 @" + prAuthor +
" - Please leave us feedback on your contributing experience! " +
"To do this, please go to `#docs-contributor-feedback` on Slack.";
let commentBody;

if (assignees) {
commentBody =
"👋 " + assignees +
" - Please leave us feedback on your contributing experience! " +
"To do this, please go to `#docs-contributor-feedback` on Slack.";
} else if (prAuthor.toLowerCase() !== "copilot") {
commentBody =
"👋 @" + prAuthor +
" - Please leave us feedback on your contributing experience! " +
"To do this, please go to `#docs-contributor-feedback` on Slack.";
} else {
// nobody to mention!
commentBody =
"👋 Please leave us feedback on your contributing experience! " +
"To do this, please go to `#docs-contributor-feedback` on Slack.";
}

// Post the comment
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
Expand Down