debian-mirror-gitlab/app/services/git/tag_push_service.rb

31 lines
569 B
Ruby
Raw Normal View History

2019-07-07 11:18:12 +05:30
# frozen_string_literal: true
module Git
2019-07-31 22:56:46 +05:30
class TagPushService < ::BaseService
2019-12-21 20:55:43 +05:30
include ChangeParams
2019-07-07 11:18:12 +05:30
def execute
2019-12-21 20:55:43 +05:30
return unless Gitlab::Git.tag_ref?(ref)
2019-07-07 11:18:12 +05:30
2019-07-31 22:56:46 +05:30
project.repository.before_push_tag
TagHooksService.new(project, current_user, params).execute
2019-07-07 11:18:12 +05:30
2020-07-28 23:09:34 +05:30
unlock_artifacts
2019-07-07 11:18:12 +05:30
true
end
2020-07-28 23:09:34 +05:30
private
def unlock_artifacts
return unless removing_tag?
Ci::RefDeleteUnlockArtifactsWorker.perform_async(project.id, current_user.id, ref)
end
def removing_tag?
Gitlab::Git.blank_ref?(newrev)
end
2019-07-07 11:18:12 +05:30
end
end