Skip to content

Commit

Permalink
feat: git commit -SkipCI ( Fixes #320 )
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Oct 15, 2024
1 parent 90a784e commit a8518e1
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions Extensions/Git.Commit.Input.UGit.Extension.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,14 @@ $CoAuthoredBy,
return $true
})]
[string[]]
$OnBehalfOf
$OnBehalfOf,

# If set, will add `[skip ci]` to the commit message.
# This will usually prevent a CI/CD system from running a build.
# This is supported by GitHub Workflows, Azure DevOps Pipelines, and GitLab (to name a few).
[Alias('CISkip','NoCI','SkipActions','ActionSkip')]
[switch]
$SkipCI
)


Expand Down Expand Up @@ -194,15 +201,29 @@ if ($type) # (if -Type was provided)
}
"-m"
# construct a conventional commit message.
"${type}$(if ($scope) { "($scope)" }): $Description$(if ($Fixes) { " ( $fixes )"})"
"${type}$(if ($scope) { "($scope)" }): $Description$(
if ($Fixes) { " ( $fixes )"}
)$(
if ($SkipCI) {
" [skip ci]"
}
)"
}

# If title was provided, pass it as a message
elseif ($Title) {
if ($Fix) {
if ($Title) {"-m";"$title$(if ($Fixes) { " ( $fixes )"})"}
if ($Title) {"-m";"$title$(if ($Fixes) { " ( $fixes )"})$(
if ($SkipCI) {
" [skip ci] "
}
)"}
} else {
if ($Title) {"-m";$title}
if ($Title) {"-m";"$title$(
if ($SkipCI) {
" [skip ci] "
}
)"}
}
}

Expand Down

0 comments on commit a8518e1

Please sign in to comment.