Class: Dependabot::PullRequestCreator::Codecommit
- Inherits:
-
Object
- Object
- Dependabot::PullRequestCreator::Codecommit
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/pull_request_creator/codecommit.rb
Constant Summary collapse
- PR_DESCRIPTION_MAX_LENGTH =
CodeCommit limits PR descriptions to a max length of 10,240 characters: docs.aws.amazon.com/codecommit/latest/APIReference/API_PullRequest.html
10_239
Instance Attribute Summary collapse
-
#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.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#labeler ⇒ Object
readonly
Returns the value of attribute labeler.
-
#pr_description ⇒ Object
readonly
Returns the value of attribute pr_description.
-
#pr_name ⇒ Object
readonly
Returns the value of attribute pr_name.
-
#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:, labeler:, require_up_to_date_base:) ⇒ Codecommit
constructor
A new instance of Codecommit.
Constructor Details
#initialize(source:, branch_name:, base_commit:, credentials:, files:, commit_message:, pr_description:, pr_name:, author_details:, labeler:, require_up_to_date_base:) ⇒ Codecommit
Returns a new instance of Codecommit.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 64 def initialize(source:, branch_name:, base_commit:, credentials:, files:, commit_message:, pr_description:, pr_name:, author_details:, labeler:, 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 = @labeler = labeler @require_up_to_date_base = require_up_to_date_base end |
Instance Attribute Details
#author_details ⇒ Object (readonly)
Returns the value of attribute author_details.
39 40 41 |
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 39 def @author_details end |
#base_commit ⇒ Object (readonly)
Returns the value of attribute base_commit.
21 22 23 |
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 21 def base_commit @base_commit end |
#branch_name ⇒ Object (readonly)
Returns the value of attribute branch_name.
18 19 20 |
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 18 def branch_name @branch_name end |
#commit_message ⇒ Object (readonly)
Returns the value of attribute commit_message.
30 31 32 |
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 30 def @commit_message end |
#credentials ⇒ Object (readonly)
Returns the value of attribute credentials.
24 25 26 |
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 24 def credentials @credentials end |
#files ⇒ Object (readonly)
Returns the value of attribute files.
27 28 29 |
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 27 def files @files end |
#labeler ⇒ Object (readonly)
Returns the value of attribute labeler.
42 43 44 |
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 42 def labeler @labeler end |
#pr_description ⇒ Object (readonly)
Returns the value of attribute pr_description.
33 34 35 |
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 33 def pr_description @pr_description end |
#pr_name ⇒ Object (readonly)
Returns the value of attribute pr_name.
36 37 38 |
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 36 def pr_name @pr_name end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
15 16 17 |
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 15 def source @source end |
Instance Method Details
#create ⇒ Object
81 82 83 84 85 86 |
# File 'lib/dependabot/pull_request_creator/codecommit.rb', line 81 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_pull_request end |