diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-02 15:10:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-02 15:10:10 +0300 |
commit | 02e597943fcd131d51b63bfa20a17cf8438adde2 (patch) | |
tree | 36a196220a0866855051802f370500f34d68d9e1 /lib | |
parent | 78bc39880c4b06b2fbe682e0201722a11237a425 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/commit_statuses.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/api/commit_statuses.rb b/lib/api/commit_statuses.rb index 1785362656e..c89abf72e2d 100644 --- a/lib/api/commit_statuses.rb +++ b/lib/api/commit_statuses.rb @@ -78,13 +78,16 @@ module API name = params[:name] || params[:context] || 'default' - pipeline ||= user_project.ci_pipelines.create!( + pipeline ||= user_project.ci_pipelines.build( source: :external, sha: commit.sha, ref: ref, user: current_user, protected: user_project.protected_for?(ref)) + pipeline.ensure_project_iid! + pipeline.save! + authorize! :update_pipeline, pipeline status = GenericCommitStatus.running_or_pending.find_or_initialize_by( |