@@ -9,6 +9,7 @@ class CreateReleaseBackmergePullRequestAction < Action
99 DEFAULT_BRANCH = 'trunk'
1010
1111 def self . run ( params )
12+ api_url = params [ :api_url ]
1213 token = params [ :github_token ]
1314 repository = params [ :repository ]
1415 source_branch = params [ :source_branch ]
@@ -41,6 +42,7 @@ def self.run(params)
4142 Fastlane ::Helper ::GitHelper . checkout_and_pull ( source_branch )
4243
4344 create_backmerge_pr (
45+ api_url : api_url ,
4446 token : token ,
4547 repository : repository ,
4648 title : "Merge #{ source_branch } into #{ target_branch } " ,
@@ -76,6 +78,7 @@ def self.determine_target_branches(source_release_version:, default_branch:)
7678
7779 # Creates a backmerge pull request using the `create_pull_request` Fastlane Action.
7880 #
81+ # @param api_url [String] the GitHub API URL to use for creating the pull request
7982 # @param token [String] the GitHub token for authentication.
8083 # @param repository [String] the repository where the pull request will be created.
8184 # @param title [String] the title of the pull request.
@@ -90,7 +93,7 @@ def self.determine_target_branches(source_release_version:, default_branch:)
9093 #
9194 # @return [String] The URL of the created Pull Request, or `nil` if no PR was created.
9295 #
93- def self . create_backmerge_pr ( token :, repository :, title :, head_branch :, base_branch :, labels :, milestone :, reviewers :, team_reviewers :, intermediate_branch_created_callback :)
96+ def self . create_backmerge_pr ( api_url : , token :, repository :, title :, head_branch :, base_branch :, labels :, milestone :, reviewers :, team_reviewers :, intermediate_branch_created_callback :) # rubocop:disable Metrics/ParameterLists
9497 # Do an early pre-check to see if the PR would be valid, but only if no callback (as a callback might add new commits on intermediate branch)
9598 if intermediate_branch_created_callback . nil? && !can_merge? ( head_branch , into : base_branch )
9699 UI . error ( "Nothing to merge from #{ head_branch } into #{ base_branch } . Skipping PR creation." )
@@ -136,6 +139,7 @@ def self.create_backmerge_pr(token:, repository:, title:, head_branch:, base_bra
136139 BODY
137140
138141 other_action . create_pull_request (
142+ api_url : api_url ,
139143 api_token : token ,
140144 repo : repository ,
141145 title : title ,
@@ -192,6 +196,10 @@ def self.details
192196
193197 def self . available_options
194198 [
199+ FastlaneCore ::ConfigItem . new ( key : :api_url ,
200+ description : 'The GitHub API URL to use for creating the pull request. Primarily used when working with GitHub Enterprise instances' ,
201+ optional : true ,
202+ type : String ) ,
195203 FastlaneCore ::ConfigItem . new ( key : :repository ,
196204 env_name : 'GHHELPER_REPOSITORY' ,
197205 description : 'The remote path of the GH repository on which we work' ,
0 commit comments