From 087e71665639d84bab0cd5e70d82955b1336b8db Mon Sep 17 00:00:00 2001 From: Leonard Jonathan Oh Date: Thu, 21 Sep 2023 04:55:41 +0000 Subject: [PATCH] Refactor: Use `git commit --sign-off` in `New-DockerImageVariantsPR` --- .../public/New-DockerImageVariantsPR.ps1 | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/Generate-DockerImageVariantsHelpers/public/New-DockerImageVariantsPR.ps1 b/src/Generate-DockerImageVariantsHelpers/public/New-DockerImageVariantsPR.ps1 index 6419d6b..38bfbbf 100644 --- a/src/Generate-DockerImageVariantsHelpers/public/New-DockerImageVariantsPR.ps1 +++ b/src/Generate-DockerImageVariantsHelpers/public/New-DockerImageVariantsPR.ps1 @@ -46,17 +46,9 @@ function New-DockerImageVariantsPR { "enhancement/bump-v$( $Version.Major ).$( $Version.Minor )-variants-to-v$( $VersionNew )" } $COMMIT_MSG = if ($Verb -eq 'add') { - @" -Enhancement: Add v$( $Version.Major ).$( $Version.Minor ).$( $Version.Build ) variants - -Signed-off-by: $( { git config --global user.name } | Execute-Command ) <$( { git config --global user.email } | Execute-Command )> -"@ + "Enhancement: Add v$( $Version.Major ).$( $Version.Minor ).$( $Version.Build ) variants" }elseif ($Verb -eq 'update') { - @" -Enhancement: Bump v$( $Version.Major ).$( $Version.Minor ) variants to v$( $VersionNew ) - -Signed-off-by: $( { git config --global user.name } | Execute-Command ) <$( { git config --global user.email } | Execute-Command )> -"@ + "Enhancement: Bump v$( $Version.Major ).$( $Version.Minor ) variants to v$( $VersionNew )" } $existingBranch = { git rev-parse --verify $BRANCH } | Execute-Command -ErrorAction Continue if ($existingBranch) { @@ -64,7 +56,7 @@ Signed-off-by: $( { git config --global user.name } | Execute-Command ) <$( { gi } { git checkout -b $BRANCH } | Execute-Command | Write-Host { git add . } | Execute-Command | Write-Host - { git commit -m "$COMMIT_MSG" } | Execute-Command | Write-Host + { git commit -m "$COMMIT_MSG" --signoff } | Execute-Command | Write-Host { git push origin $BRANCH -f } | Execute-Command | Write-Host # }