diff options
author | Achilleas Pipinellis <axil@gitlab.com> | 2020-05-22 11:34:10 +0300 |
---|---|---|
committer | Achilleas Pipinellis <axil@gitlab.com> | 2020-05-22 11:34:10 +0300 |
commit | e505621c16cf553e912e01f848299be26cad2cbd (patch) | |
tree | 9da12f4e39762223c6231c2af371d07aa6b4cef1 /lib | |
parent | 6279e06826365a26d5f078c7266166ebea6e3f9a (diff) |
Check if a local branch exists and abort the task if true
Diffstat (limited to 'lib')
-rw-r--r-- | lib/task_helpers.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/task_helpers.rb b/lib/task_helpers.rb index b3be0010..be79af49 100644 --- a/lib/task_helpers.rb +++ b/lib/task_helpers.rb @@ -51,6 +51,11 @@ def git_workdir_dirty? !status.empty? end +def local_branch_exist?(branch) + status = `git branch --list #{branch}` + !status.empty? +end + def chart_version_added?(gitlab_version) config = YAML.load_file('./content/_data/chart_versions.yaml') config.key?(gitlab_version) |