Added the CI_REF_PROTECTED variable to the Gitlab runner
This variable shows if the branch the runner is executing is protected or not. References: #50909
This commit is contained in:
parent
e861af409d
commit
af46d33fba
4 changed files with 6 additions and 3 deletions
|
@ -638,6 +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)
|
||||
|
||||
if merge_request_event? && merge_request
|
||||
variables.append(key: 'CI_MERGE_REQUEST_SOURCE_BRANCH_SHA', value: source_sha.to_s)
|
||||
|
|
|
@ -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_COMMIT_TITLE CI_COMMIT_DESCRIPTION CI_REF_PROTECTED
|
||||
]
|
||||
|
||||
expect(bridge.scoped_variables_hash.keys).to include(*variables)
|
||||
|
|
|
@ -2227,7 +2227,8 @@ describe Ci::Build do
|
|||
{ key: 'CI_PIPELINE_SOURCE', value: pipeline.source, public: true, masked: false },
|
||||
{ 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_DESCRIPTION', value: pipeline.git_commit_description, public: true, masked: false },
|
||||
{ key: 'CI_REF_PROTECTED', value: pipeline.protected_ref?.to_s, public: true, masked: false }
|
||||
]
|
||||
end
|
||||
|
||||
|
|
|
@ -670,7 +670,8 @@ describe Ci::Pipeline, :mailer do
|
|||
CI_PIPELINE_SOURCE
|
||||
CI_COMMIT_MESSAGE
|
||||
CI_COMMIT_TITLE
|
||||
CI_COMMIT_DESCRIPTION]
|
||||
CI_COMMIT_DESCRIPTION
|
||||
CI_REF_PROTECTED]
|
||||
end
|
||||
|
||||
context 'when source is merge request' do
|
||||
|
|
Loading…
Reference in a new issue