Skip to content

Commit f8a02ba

Browse files
azure-sdkraych1
andauthored
Sync eng/common directory with azure-sdk-tools for PR 12222 (#43137)
* Set pr creator to empty when it's bot * Removed bot accounts while setting the reviewers and assignees * Allowed copilot as reviewer --------- Co-authored-by: ray chen <[email protected]>
1 parent def10f4 commit f8a02ba

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

eng/common/scripts/Submit-PullRequest.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@ else {
130130

131131
# ensure that the user that was used to create the PR is not attempted to add as a reviewer
132132
# we cast to an array to ensure that length-1 arrays actually stay as array values
133-
$cleanedUsers = @(SplitParameterArray -members $UserReviewers) | ? { $_ -ne $prOwnerUser -and $null -ne $_ }
133+
# we also filter out dependabot user who doesn't have write permission to avoid errors
134+
$cleanedUsers = @(SplitParameterArray -members $UserReviewers) | ? { $_ -ne $prOwnerUser -and $null -ne $_ -and $_ -inotlike "dependabot*" }
134135
$cleanedTeamReviewers = @(SplitParameterArray -members $TeamReviewers) | ? { $_ -ne $prOwnerUser -and $null -ne $_ }
135136

136137
if ($cleanedUsers -or $cleanedTeamReviewers) {
@@ -146,8 +147,13 @@ else {
146147
$prState = "open"
147148
}
148149

150+
# Clean assignees - remove null entries and bot accounts
151+
$cleanedAssignees = @(SplitParameterArray -members $Assignees) | ? {
152+
$null -ne $_ -and $_ -inotlike "dependabot*" -and $_ -inotlike "copilot*"
153+
}
154+
149155
Update-GitHubIssue -RepoOwner $RepoOwner -RepoName $RepoName -IssueNumber $prNumber `
150-
-State $prState -Labels $PRLabels -Assignees $Assignees -AuthToken $AuthToken
156+
-State $prState -Labels $PRLabels -Assignees $cleanedAssignees -AuthToken $AuthToken
151157

152158
if ($AddBuildSummary) {
153159
$summaryPath = New-TemporaryFile

0 commit comments

Comments
 (0)