Skip to content

Commit

Permalink
Merge pull request #83 from theohbrothers/refactor/use-git-commit-sig…
Browse files Browse the repository at this point in the history
…n-off-in-new-dockerimagevariantspr

Refactor: Use `git commit --sign-off` in `New-DockerImageVariantsPR`
  • Loading branch information
leojonathanoh authored Sep 21, 2023
2 parents 6c00615 + 087e716 commit dc03d12
Showing 1 changed file with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,17 @@ 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) {
{ git branch -D $BRANCH } | Execute-Command | Write-Host
}
{ 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
# }

Expand Down

0 comments on commit dc03d12

Please sign in to comment.