Skip to content

Commit ae4d15e

Browse files
authored
[Ignore] Ignore commits for changelog starting with [ignore] (#1495)
* Ignore commits for changelog starting with [ignore]
1 parent 969e460 commit ae4d15e

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

tools/Get-PowerShellExtensionChangelog.ps1

+8-14
Original file line numberDiff line numberDiff line change
@@ -300,30 +300,24 @@ function Get-ChangeLog
300300
$new_commits = $new_commits_during_last_release + $new_commits_after_last_release
301301
}
302302

303+
$new_commits = $new_commits | Where-Object { -not $_.Subject.StartsWith('[Ignore]', [System.StringComparison]::OrdinalIgnoreCase) }
304+
303305
foreach ($commit in $new_commits) {
304306
$messageParts = Get-PRNumberFromCommitSubject $commit.Subject
305-
if ($messageParts)
306-
{
307+
if ($messageParts) {
307308
$message = $messageParts.Message
308309
$prNumber = $messageParts.PR
309-
}
310-
else
311-
{
310+
} else {
312311
$message = $commit.Subject
313312
}
314313

315-
if (-not ($commit.AuthorEmail.EndsWith("@microsoft.com") -or ($powershell_team -contains $commit.AuthorName) -or ($powershell_team_emails -contains $commit.AuthorEmail)))
316-
{
317-
if ($Script:community_login_map.ContainsKey($commit.AuthorEmail))
318-
{
314+
if (-not ($commit.AuthorEmail.EndsWith("@microsoft.com") -or ($powershell_team -contains $commit.AuthorName) -or ($powershell_team_emails -contains $commit.AuthorEmail))) {
315+
if ($Script:community_login_map.ContainsKey($commit.AuthorEmail)) {
319316
$commit.AuthorGitHubLogin = $Script:community_login_map[$commit.AuthorEmail]
320-
}
321-
else
322-
{
317+
} else {
323318
$uri = "$RepoUri/commits/$($commit.Hash)"
324319
$response = Invoke-WebRequest -Uri $uri -Method Get -Headers $header -ErrorAction SilentlyContinue
325-
if($response)
326-
{
320+
if($response) {
327321
$content = ConvertFrom-Json -InputObject $response.Content
328322
$commit.AuthorGitHubLogin = $content.author.login
329323
$Script:community_login_map[$commit.AuthorEmail] = $commit.AuthorGitHubLogin

0 commit comments

Comments
 (0)