summaryrefslogtreecommitdiff
path: root/lib/api/commit_statuses.rb
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2017-09-04 08:23:50 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2017-09-04 08:23:50 +0000
commitd449355f94e54788efb70e8998327720060afddc (patch)
treea140bc43e2ac498d6fd2c20defde3afccf3f392c /lib/api/commit_statuses.rb
parenta343484bdf6de75383c4667cc6b161a5c47dbeef (diff)
parent53b5346d407d2303e88d8cf5d6e9271996051cf1 (diff)
downloadgitlab-ce-d449355f94e54788efb70e8998327720060afddc.tar.gz
Merge branch 'feature/sm/33281-protected-runner-executes-jobs-on-protected-branch' into 'master'
Protected runner executes jobs on protected branch [Solution 1] Closes #33281 See merge request !13194
Diffstat (limited to 'lib/api/commit_statuses.rb')
-rw-r--r--lib/api/commit_statuses.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/commit_statuses.rb b/lib/api/commit_statuses.rb
index 78e889a4c35..6314ea63197 100644
--- a/lib/api/commit_statuses.rb
+++ b/lib/api/commit_statuses.rb
@@ -74,7 +74,8 @@ module API
source: :external,
sha: commit.sha,
ref: ref,
- user: current_user)
+ user: current_user,
+ protected: @project.protected_for?(ref))
end
status = GenericCommitStatus.running_or_pending.find_or_initialize_by(
@@ -82,7 +83,8 @@ module API
pipeline: pipeline,
name: name,
ref: ref,
- user: current_user
+ user: current_user,
+ protected: @project.protected_for?(ref)
)
optional_attributes =