Skip to content

Commit 8ffc0b0

Browse files
authored
Support non-GitHub commits in the change log generation script (PowerShell#6389)
1 parent 8ba6f31 commit 8ffc0b0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

tools/releaseTools.psm1

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ class CommitNode {
2323

2424
if ($subject -match "\(#(\d+)\)") {
2525
$this.PullRequest = $Matches[1]
26-
} else {
27-
throw "PR number is missing from the commit subject. (commit: $hash)"
2826
}
2927
}
3028
}
@@ -175,10 +173,13 @@ function Get-ChangeLog
175173
$commit.AuthorGitHubLogin = $community_login_map[$commit.AuthorEmail]
176174
} else {
177175
$uri = "https://api.github.com/repos/PowerShell/PowerShell/commits/$($commit.Hash)"
178-
$response = Invoke-WebRequest -Uri $uri -Method Get -Headers $header
179-
$content = ConvertFrom-Json -InputObject $response.Content
180-
$commit.AuthorGitHubLogin = $content.author.login
181-
$community_login_map[$commit.AuthorEmail] = $commit.AuthorGitHubLogin
176+
$response = Invoke-WebRequest -Uri $uri -Method Get -Headers $header -ErrorAction SilentlyContinue
177+
if($response)
178+
{
179+
$content = ConvertFrom-Json -InputObject $response.Content
180+
$commit.AuthorGitHubLogin = $content.author.login
181+
$community_login_map[$commit.AuthorEmail] = $commit.AuthorGitHubLogin
182+
}
182183
}
183184
$commit.ChangeLogMessage = "- {0} (Thanks @{1}!)" -f $commit.Subject, $commit.AuthorGitHubLogin
184185
}

0 commit comments

Comments
 (0)