Class: Dependabot::PullRequestCreator::Github
- Inherits:
-
Object
- Object
- Dependabot::PullRequestCreator::Github
- Defined in:
- lib/dependabot/pull_request_creator/github.rb
Overview
rubocop:disable Metrics/ClassLength
Constant Summary collapse
- MAX_PR_DESCRIPTION_LENGTH =
characters (see #create_pull_request)
65_536
Instance Attribute Summary collapse
-
#assignees ⇒ Object
readonly
Returns the value of attribute assignees.
-
#author_details ⇒ Object
readonly
Returns the value of attribute author_details.
-
#base_commit ⇒ Object
readonly
Returns the value of attribute base_commit.
-
#branch_name ⇒ Object
readonly
Returns the value of attribute branch_name.
-
#commit_message ⇒ Object
readonly
Returns the value of attribute commit_message.
-
#credentials ⇒ Object
readonly
Returns the value of attribute credentials.
-
#custom_headers ⇒ Object
readonly
Returns the value of attribute custom_headers.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#labeler ⇒ Object
readonly
Returns the value of attribute labeler.
-
#milestone ⇒ Object
readonly
Returns the value of attribute milestone.
-
#pr_description ⇒ Object
readonly
Returns the value of attribute pr_description.
-
#pr_name ⇒ Object
readonly
Returns the value of attribute pr_name.
-
#reviewers ⇒ Object
readonly
Returns the value of attribute reviewers.
-
#signature_key ⇒ Object
readonly
Returns the value of attribute signature_key.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(source:, branch_name:, base_commit:, credentials:, files:, commit_message:, pr_description:, pr_name:, author_details:, signature_key:, custom_headers:, labeler:, reviewers:, assignees:, milestone:, require_up_to_date_base:) ⇒ Github
constructor
A new instance of Github.
Constructor Details
#initialize(source:, branch_name:, base_commit:, credentials:, files:, commit_message:, pr_description:, pr_name:, author_details:, signature_key:, custom_headers:, labeler:, reviewers:, assignees:, milestone:, require_up_to_date_base:) ⇒ Github
Returns a new instance of Github.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 19 def initialize(source:, branch_name:, base_commit:, credentials:, files:, commit_message:, pr_description:, pr_name:, author_details:, signature_key:, custom_headers:, labeler:, reviewers:, assignees:, milestone:, require_up_to_date_base:) @source = source @branch_name = branch_name @base_commit = base_commit @credentials = credentials @files = files @commit_message = @pr_description = pr_description @pr_name = pr_name @author_details = @signature_key = signature_key @custom_headers = custom_headers @labeler = labeler @reviewers = reviewers @assignees = assignees @milestone = milestone @require_up_to_date_base = require_up_to_date_base end |
Instance Attribute Details
#assignees ⇒ Object (readonly)
Returns the value of attribute assignees.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def assignees @assignees end |
#author_details ⇒ Object (readonly)
Returns the value of attribute author_details.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def @author_details end |
#base_commit ⇒ Object (readonly)
Returns the value of attribute base_commit.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def base_commit @base_commit end |
#branch_name ⇒ Object (readonly)
Returns the value of attribute branch_name.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def branch_name @branch_name end |
#commit_message ⇒ Object (readonly)
Returns the value of attribute commit_message.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def @commit_message end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def credentials @credentials end |
#custom_headers ⇒ Object (readonly)
Returns the value of attribute custom_headers.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def custom_headers @custom_headers end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def files @files end |
#labeler ⇒ Object (readonly)
Returns the value of attribute labeler.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def labeler @labeler end |
#milestone ⇒ Object (readonly)
Returns the value of attribute milestone.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def milestone @milestone end |
#pr_description ⇒ Object (readonly)
Returns the value of attribute pr_description.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def pr_description @pr_description end |
#pr_name ⇒ Object (readonly)
Returns the value of attribute pr_name.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def pr_name @pr_name end |
#reviewers ⇒ Object (readonly)
Returns the value of attribute reviewers.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def reviewers @reviewers end |
#signature_key ⇒ Object (readonly)
Returns the value of attribute signature_key.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def signature_key @signature_key end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
14 15 16 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 14 def source @source end |
Instance Method Details
#create ⇒ Object
42 43 44 45 46 47 48 49 |
# File 'lib/dependabot/pull_request_creator/github.rb', line 42 def create return if branch_exists?(branch_name) && unmerged_pull_request_exists? return if require_up_to_date_base? && !base_commit_is_up_to_date? create_annotated_pull_request rescue AnnotationError, Octokit::Error => e handle_error(e) end |