Class: Ruboty::Github::Actions::CloseIssue

Inherits:
Base
  • Object
show all
Defined in:
lib/ruboty/github/actions/close_issue.rb

Direct Known Subclasses

MergePullRequest

Constant Summary

Constants inherited from Base

Base::NAMESPACE

Instance Attribute Summary

Attributes inherited from Base

#message

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Ruboty::Github::Actions::Base

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ruboty/github/actions/close_issue.rb', line 7

def call
  if !has_access_token?
    require_access_token
  elsif has_closed_issue_number?
    reply_already_closed
  else
    close
  end
rescue Octokit::Unauthorized
  message.reply('Failed in authentication (401)')
rescue Octokit::NotFound
  message.reply('Could not find that issue')
rescue StandardError => e
  raise e
  message.reply("Failed by #{e.class}")
end