summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason van den Hurk <jasonhurk@gmail.com>2019-04-10 12:56:56 +0200
committerJason van den Hurk <jasonhurk@gmail.com>2019-04-10 12:56:56 +0200
commit8d1649f77460b1203e6497b91342cc08b93ae160 (patch)
tree4a9cf646fd55287c7ef1a00de9a8b0834bbabe3b
parentcd0eaccbfe59b7ac1e63aa59658ced2dc2ea27df (diff)
downloadgitlab-ce-8d1649f77460b1203e6497b91342cc08b93ae160.tar.gz
Change CI_REF_PROTECTED variable to CI_COMMIT_REF_PROTECTED
-rw-r--r--app/models/ci/pipeline.rb2
-rw-r--r--changelogs/unreleased/add-ci-variable-protected-ref.yml2
-rw-r--r--doc/ci/variables/predefined_variables.md2
-rw-r--r--spec/models/ci/bridge_spec.rb2
-rw-r--r--spec/models/ci/build_spec.rb2
-rw-r--r--spec/models/ci/pipeline_spec.rb2
6 files changed, 6 insertions, 6 deletions
diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb
index 9e382d483f1..7aad4d2c176 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_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/changelogs/unreleased/add-ci-variable-protected-ref.yml b/changelogs/unreleased/add-ci-variable-protected-ref.yml
index 9e44232fdff..150ddcc21ad 100644
--- a/changelogs/unreleased/add-ci-variable-protected-ref.yml
+++ b/changelogs/unreleased/add-ci-variable-protected-ref.yml
@@ -1,5 +1,5 @@
---
-title: Add CI_REF_PROTECTED CI variable
+title: Add CI_COMMIT_REF_PROTECTED CI variable
merge_request: 26716
author: Jason van den Hurk
type: added
diff --git a/doc/ci/variables/predefined_variables.md b/doc/ci/variables/predefined_variables.md
index 1c2908e7e9b..05bde5ed4c8 100644
--- a/doc/ci/variables/predefined_variables.md
+++ b/doc/ci/variables/predefined_variables.md
@@ -84,7 +84,7 @@ future GitLab releases.**
| `CI_PROJECT_PATH_SLUG` | 9.3 | all | `$CI_PROJECT_PATH` lowercased and with everything except `0-9` and `a-z` replaced with `-`. Use in URLs and domain names. |
| `CI_PROJECT_URL` | 8.10 | 0.5 | The HTTP(S) address to access project |
| `CI_PROJECT_VISIBILITY` | 10.3 | all | The project visibility (internal, private, public) |
-| `CI_REF_PROTECTED` | 11.11 | all | If the job is running on a protected branch |
+| `CI_COMMIT_REF_PROTECTED` | 11.11 | all | If the job is running on a protected branch |
| `CI_REGISTRY` | 8.10 | 0.5 | If the Container Registry is enabled it returns the address of GitLab's Container Registry |
| `CI_REGISTRY_IMAGE` | 8.10 | 0.5 | If the Container Registry is enabled for the project it returns the address of the registry tied to the specific project |
| `CI_REGISTRY_PASSWORD` | 9.0 | all | The password to use to push containers to the GitLab Container Registry |
diff --git a/spec/models/ci/bridge_spec.rb b/spec/models/ci/bridge_spec.rb
index fce53a96857..44b5af5e5aa 100644
--- a/spec/models/ci/bridge_spec.rb
+++ b/spec/models/ci/bridge_spec.rb
@@ -33,7 +33,7 @@ describe Ci::Bridge do
CI_PROJECT_ID CI_PROJECT_NAME CI_PROJECT_PATH
CI_PROJECT_PATH_SLUG CI_PROJECT_NAMESPACE CI_PIPELINE_IID
CI_CONFIG_PATH CI_PIPELINE_SOURCE CI_COMMIT_MESSAGE
- CI_COMMIT_TITLE CI_COMMIT_DESCRIPTION CI_REF_PROTECTED
+ CI_COMMIT_TITLE CI_COMMIT_DESCRIPTION CI_COMMIT_REF_PROTECTED
]
expect(bridge.scoped_variables_hash.keys).to include(*variables)
diff --git a/spec/models/ci/build_spec.rb b/spec/models/ci/build_spec.rb
index 4c717357bd0..7af5237a503 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_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
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index 9b86fbbefe8..f3310ff0f82 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -671,7 +671,7 @@ describe Ci::Pipeline, :mailer do
CI_COMMIT_MESSAGE
CI_COMMIT_TITLE
CI_COMMIT_DESCRIPTION
- CI_REF_PROTECTED]
+ CI_COMMIT_REF_PROTECTED]
end
context 'when source is merge request' do