Welcome to mirror list, hosted at ThFree Co, Russian Federation.

tag_push_service.rb « git « services « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 641fe8e3916e1ac3080b2e7c8020a85084a5a7cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true

module Git
  class TagPushService < ::BaseService
    include ChangeParams

    def execute
      return unless Gitlab::Git.tag_ref?(ref)

      project.repository.before_push_tag
      TagHooksService.new(project, current_user, params).execute

      unlock_artifacts

      true
    end

    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
  end
end