@@ -9,6 +9,7 @@ class CreateReleaseBackmergePullRequestAction < Action
9
9
DEFAULT_BRANCH = 'trunk'
10
10
11
11
def self . run ( params )
12
+ api_url = params [ :api_url ]
12
13
token = params [ :github_token ]
13
14
repository = params [ :repository ]
14
15
source_branch = params [ :source_branch ]
@@ -41,6 +42,7 @@ def self.run(params)
41
42
Fastlane ::Helper ::GitHelper . checkout_and_pull ( source_branch )
42
43
43
44
create_backmerge_pr (
45
+ api_url : api_url ,
44
46
token : token ,
45
47
repository : repository ,
46
48
title : "Merge #{ source_branch } into #{ target_branch } " ,
@@ -76,6 +78,7 @@ def self.determine_target_branches(source_release_version:, default_branch:)
76
78
77
79
# Creates a backmerge pull request using the `create_pull_request` Fastlane Action.
78
80
#
81
+ # @param api_url [String] the GitHub API URL to use for creating the pull request
79
82
# @param token [String] the GitHub token for authentication.
80
83
# @param repository [String] the repository where the pull request will be created.
81
84
# @param title [String] the title of the pull request.
@@ -90,7 +93,7 @@ def self.determine_target_branches(source_release_version:, default_branch:)
90
93
#
91
94
# @return [String] The URL of the created Pull Request, or `nil` if no PR was created.
92
95
#
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
94
97
# 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)
95
98
if intermediate_branch_created_callback . nil? && !can_merge? ( head_branch , into : base_branch )
96
99
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
136
139
BODY
137
140
138
141
other_action . create_pull_request (
142
+ api_url : api_url ,
139
143
api_token : token ,
140
144
repo : repository ,
141
145
title : title ,
@@ -192,6 +196,10 @@ def self.details
192
196
193
197
def self . available_options
194
198
[
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 ) ,
195
203
FastlaneCore ::ConfigItem . new ( key : :repository ,
196
204
env_name : 'GHHELPER_REPOSITORY' ,
197
205
description : 'The remote path of the GH repository on which we work' ,
0 commit comments