summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason van den Hurk <jasonhurk@gmail.com>2019-04-18 11:34:20 +0200
committerJason van den Hurk <jasonhurk@gmail.com>2019-04-18 11:36:31 +0200
commitd1b2056c155f49004a80280e46d7136fd804ad98 (patch)
tree09aef096163e07d7b43f33b2838fcf00b83c53f7
parent8d1649f77460b1203e6497b91342cc08b93ae160 (diff)
downloadgitlab-ce-d1b2056c155f49004a80280e46d7136fd804ad98.tar.gz
Make sure that CI_COMMIT_REF_PROTECTED is a bool
-rw-r--r--app/models/ci/pipeline.rb2
-rw-r--r--spec/models/ci/build_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 7aad4d2c176..3d6ee675944 100644
--- a/app/models/ci/pipeline.rb
+++ b/app/models/ci/pipeline.rb
@@ -638,7 +638,7 @@ module Ci
variables.append(key: 'CI_COMMIT_MESSAGE', value: git_commit_message.to_s)
variables.append(key: 'CI_COMMIT_TITLE', value: git_commit_full_title.to_s)
variables.append(key: 'CI_COMMIT_DESCRIPTION', value: git_commit_description.to_s)
- variables.append(key: 'CI_COMMIT_REF_PROTECTED', value: protected_ref?.to_s)
+ variables.append(key: 'CI_COMMIT_REF_PROTECTED', value: (!!protected_ref?).to_s)
if merge_request_event? && merge_request
variables.append(key: 'CI_MERGE_REQUEST_SOURCE_BRANCH_SHA', value: source_sha.to_s)
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index 7af5237a503..a63da211a03 100644
--- a/spec/models/ci/build_spec.rb
+++ b/spec/models/ci/build_spec.rb
@@ -2228,7 +2228,7 @@ describe Ci::Build do
{ key: 'CI_COMMIT_MESSAGE', value: pipeline.git_commit_message, public: true, masked: false },
{ key: 'CI_COMMIT_TITLE', value: pipeline.git_commit_title, public: true, masked: false },
{ key: 'CI_COMMIT_DESCRIPTION', value: pipeline.git_commit_description, public: true, masked: false },
- { key: 'CI_COMMIT_REF_PROTECTED', value: pipeline.protected_ref?.to_s, public: true, masked: false }
+ { key: 'CI_COMMIT_REF_PROTECTED', value: (!!pipeline.protected_ref?).to_s, public: true, masked: false }
]
end