diff options
Diffstat (limited to 'lib/api/deployments.rb')
-rw-r--r-- | lib/api/deployments.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/api/deployments.rb b/lib/api/deployments.rb index 8161c2b850f..1468164081c 100644 --- a/lib/api/deployments.rb +++ b/lib/api/deployments.rb @@ -139,6 +139,8 @@ module API authorize!(:create_deployment, user_project) authorize!(:create_environment, user_project) + render_api_error!({ ref: ["The branch or tag does not exist"] }, 400) unless user_project.commit(declared_params[:ref]) + environment = user_project .environments .find_or_create_by_name(params[:environment]) |