diff options
Diffstat (limited to 'lib/gitlab/audit/deploy_token_author.rb')
-rw-r--r-- | lib/gitlab/audit/deploy_token_author.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/gitlab/audit/deploy_token_author.rb b/lib/gitlab/audit/deploy_token_author.rb new file mode 100644 index 00000000000..69b42034826 --- /dev/null +++ b/lib/gitlab/audit/deploy_token_author.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +module Gitlab + module Audit + class DeployTokenAuthor < Gitlab::Audit::NullAuthor + def initialize(name: nil) + super(id: -2, name: name) + end + + # Events that are authored by a deploy token, should be + # shown as authored by `Deploy Token` in the UI. + def name + @name || _('Deploy Token') + end + end + end +end |