Skip to content

Commit

Permalink
Enhancement (generate): Standardize processing of commit history acro…
Browse files Browse the repository at this point in the history
…ss all variants
  • Loading branch information
joeltimothyoh committed May 26, 2024
1 parent c78dad3 commit 702c8aa
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ function Changes-HashSubject-Merges {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$releaseBody = & {
@"
## Changes
"@
$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % {
$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % {
@"
* $_
"@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function Changes-HashSubject-NoMerges-Categorized {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n"
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$commitCategory = @(
@{
Name = 'Feature'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ function Changes-HashSubject-NoMerges {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$releaseBody = & {
@"
## Changes
"@
$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % {
$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % {
@"
* $_
"@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ function Changes-HashSubject {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$releaseBody = & {
@"
## Changes
"@
$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % {
$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % {
@"
* $_
"@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function Changes-HashSubjectAuthor-NoMerges-Categorized {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n"
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$commitCategory = @(
@{
Name = 'Feature'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ function VersionDate-HashSubject-Merges {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$releaseBody = & {
@"
## $TagName ($(Get-Date -UFormat '%Y-%m-%d'))
"@
$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % {
$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % {
@"
* $_
"@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function VersionDate-HashSubject-NoMerges-Categorized {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n"
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$commitCategory = @(
@{
Name = 'Feature'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ function VersionDate-HashSubject-NoMerges {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$releaseBody = & {
@"
## $TagName ($(Get-Date -UFormat '%Y-%m-%d'))
"@
$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % {
$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % {
@"
* $_
"@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ function VersionDate-HashSubject {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$releaseBody = & {
@"
## $TagName ($(Get-Date -UFormat '%Y-%m-%d'))
"@
$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % {
$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % {
@"
* $_
"@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function VersionDate-HashSubjectAuthor-NoMerges-Categorized {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n"
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$commitCategory = @(
@{
Name = 'Feature'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ function VersionDate-Subject-Merges {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$releaseBody = & {
@"
## $TagName ($(Get-Date -UFormat '%Y-%m-%d'))
"@
$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % {
$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % {
@"
* $_
"@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function VersionDate-Subject-NoMerges-Categorized {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n"
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$commitCategory = @(
@{
Name = 'Feature'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ function VersionDate-Subject-NoMerges {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$releaseBody = & {
@"
## $TagName ($(Get-Date -UFormat '%Y-%m-%d'))
"@
$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % {
$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % {
@"
* $_
"@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ function VersionDate-Subject {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$releaseBody = & {
@"
## $TagName ($(Get-Date -UFormat '%Y-%m-%d'))
"@
$commitHistory -split "`n" | % { $_.Trim() } | ? { $_ } | % {
$commitHistoryCollection | % { $_.Trim() } | ? { $_ } | % {
@"
* $_
"@
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function VersionDate-SubjectAuthor-NoMerges-Categorized {
}
if ($previousRelease) { $funcArgs['SecondRef'] = @($previousRelease)[0] }
$commitHistory = Get-RepositoryCommitHistory @funcArgs
$commitHistoryCollection = $commitHistory -split "`n"
$commitHistoryCollection = $commitHistory -split "`n" | ? { $_ }
$commitCategory = @(
@{
Name = 'Feature'
Expand Down

0 comments on commit 702c8aa

Please sign in to comment.