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: 120c4cde94b3301e5a2e34ed7bb5b9673bb28262 (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
31
32
33
34
# 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

    def tag_name
      Gitlab::Git.ref_name(ref)
    end
  end
end