Skip to content

Commit

Permalink
Merge pull request #14693 from hennevogel/bugfix/tag-push-reporting
Browse files Browse the repository at this point in the history
Never report on Tag Push events
  • Loading branch information
rubhanazeem committed Jul 24, 2023
2 parents 9035d4e + 090c4c8 commit 1896e46
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/api/app/models/workflow/step/branch_package_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ def branch_package

scm_synced? ? set_scmsync_on_target_package : add_branch_request_file(package: target_package)

# SCMs don't support statuses for tags, so we don't need to report back in this case
Workflows::ScmEventSubscriptionCreator.new(token, workflow_run, scm_webhook, target_package).call unless scm_webhook.tag_push_event?
Workflows::ScmEventSubscriptionCreator.new(token, workflow_run, scm_webhook, target_package).call

target_package
end
Expand Down
3 changes: 1 addition & 2 deletions src/api/app/models/workflow/step/link_package_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ def link_package

set_scmsync_on_target_package if scm_synced?

# SCMs don't support statuses for tags, so we don't need to report back in this case
Workflows::ScmEventSubscriptionCreator.new(token, workflow_run, scm_webhook, target_package).call unless scm_webhook.tag_push_event?
Workflows::ScmEventSubscriptionCreator.new(token, workflow_run, scm_webhook, target_package).call

target_package
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ def initialize(token, workflow_run, scm_webhook, package)
end

def call
# SCMs don't support commit status for tags, so we don't need to report back in this case
return if @scm_webhook.tag_push_event?

['Event::BuildFail', 'Event::BuildSuccess'].each do |build_event|
EventSubscription.find_or_create_by!(eventtype: build_event,
# We pass a valid value, but we don't need this.
Expand Down

0 comments on commit 1896e46

Please sign in to comment.