Skip to content

Commit a00a779

Browse files
authored
Merge pull request #41511 from github/repo-sync
Repo sync
2 parents fc664e6 + 726258f commit a00a779

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

.github/workflows/feedback-prompt.yml

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,32 @@ jobs:
4545
with:
4646
github-token: ${{ secrets.DOCS_BOT_PAT_BASE }}
4747
script: |
48-
// Get PR author username
4948
const pr = context.payload.pull_request;
5049
const prAuthor = pr.user.login;
50+
const assignees = (pr.assignees ?? [])
51+
.filter(a => a.login.toLowerCase() !== "copilot")
52+
.map(a => "@" + a.login)
53+
.join(" ");
5154
52-
// Compose the comment body as a plain text message to post on the PR
53-
const commentBody =
54-
"👋 @" + prAuthor +
55-
" - Please leave us feedback on your contributing experience! " +
56-
"To do this, please go to `#docs-contributor-feedback` on Slack.";
55+
let commentBody;
56+
57+
if (assignees) {
58+
commentBody =
59+
"👋 " + assignees +
60+
" - Please leave us feedback on your contributing experience! " +
61+
"To do this, please go to `#docs-contributor-feedback` on Slack.";
62+
} else if (prAuthor.toLowerCase() !== "copilot") {
63+
commentBody =
64+
"👋 @" + prAuthor +
65+
" - Please leave us feedback on your contributing experience! " +
66+
"To do this, please go to `#docs-contributor-feedback` on Slack.";
67+
} else {
68+
// nobody to mention!
69+
commentBody =
70+
"👋 Please leave us feedback on your contributing experience! " +
71+
"To do this, please go to `#docs-contributor-feedback` on Slack.";
72+
}
5773
58-
// Post the comment
5974
await github.rest.issues.createComment({
6075
owner: context.repo.owner,
6176
repo: context.repo.repo,

0 commit comments

Comments
 (0)