Skip to content

Commit

Permalink
Make sure target_package exists, when PR is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
vpereira authored and Dany Marcoux committed Sep 13, 2021
1 parent 091b2aa commit bf311f7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/api/app/models/workflow/step/link_package_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ def call(options = {})

workflow_filters = options.fetch(:workflow_filters, {})

if scm_webhook.updated_pull_request? && target_package.present?
update_subscriptions(target_package, workflow_filters)
if scm_webhook.updated_pull_request?
create_target_package if target_package.blank?
create_or_update_subscriptions(target_package, workflow_filters)
elsif scm_webhook.new_pull_request?
create_target_package
create_subscriptions(target_package, workflow_filters)
Expand Down

0 comments on commit bf311f7

Please sign in to comment.