You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#In the release workflow, the release branch will be merged back to master after the release is done,
@@ -262,25 +279,76 @@ function Get-ChangeLog
262
279
$clExperimental=@()
263
280
264
281
foreach ($commitin$new_commits) {
282
+
$commitSubject=$commit.Subject
283
+
$prNumber=$commit.PullRequest
284
+
Write-Verbose"subject: $commitSubject"
265
285
Write-Verbose"authorname: $($commit.AuthorName)"
266
-
if ($commit.AuthorEmail.EndsWith("@microsoft.com") -or$powershell_team-contains$commit.AuthorName-or$Script:attribution_ignore_list-contains$commit.AuthorEmail) {
-Verbose:$false## Always disable verbose to avoid noise when we debug this function.
293
+
} catch {
294
+
## A commit may not have corresponding GitHub PRs. In that case, we will get status code 404 (Not Found).
295
+
## Otherwise, let the error bubble up.
296
+
if ($_.Exception.Response.StatusCode-ne404) {
297
+
throw
298
+
}
299
+
}
300
+
301
+
if ($commitSubject-match'^\[release/v\d\.\d\] ') {
302
+
## The commit was from a backport PR. We need to get the real author in this case.
303
+
if (-not$pr) {
304
+
throw"The commit is from a backport PR (#$prNumber), but the PR cannot be found.`nPR Title: $commitSubject"
305
+
}
306
+
307
+
$userPattern='Triggered by @.+ on behalf of @(.+)'
308
+
if ($pr.body-match$userPattern) {
309
+
$commit.AuthorGitHubLogin= ($Matches.1).Trim()
310
+
Write-Verbose"backport PR. real author login: $($commit.AuthorGitHubLogin)"
311
+
} else {
312
+
throw"The commit is from a backport PR (#$prNumber), but the PR description failed to match the pattern '$userPattern'. Was the template for backport PRs changed?`nPR Title: $commitSubject"
313
+
}
314
+
}
315
+
316
+
if ($commit.AuthorGitHubLogin) {
317
+
if ($script:psteam_logins-contains$commit.AuthorGitHubLogin) {
0 commit comments