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



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

def call
  case
  when !has_access_token?
    require_access_token
  when 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 => exception
  raise exception
  message.reply("Failed by #{exception.class}")
end