feat: Handle API URLs for Forgejo, Gitea, GitLab and GitHub
This commit is contained in:
@@ -51,8 +51,10 @@ export async function createPullRequest(inputs: Inputs): Promise<void> {
|
||||
core.startGroup('Determining the base and head repositories')
|
||||
const baseRemote = gitConfigHelper.getGitRemote()
|
||||
// Init the GitHub clients
|
||||
const ghBranch = new GitHubHelper(baseRemote.hostname, inputs.branchToken)
|
||||
const ghPull = new GitHubHelper(baseRemote.hostname, inputs.token)
|
||||
const apiUrl = await GitHubHelper.determineApiUrl(baseRemote.hostname);
|
||||
core.info(`Using API base URL: ${apiUrl}`);
|
||||
const ghBranch = new GitHubHelper(apiUrl, inputs.branchToken)
|
||||
const ghPull = new GitHubHelper(apiUrl, inputs.token)
|
||||
// Determine the head repository; the target for the pull request branch
|
||||
const branchRemoteName = inputs.pushToFork ? 'fork' : 'origin'
|
||||
const branchRepository = inputs.pushToFork
|
||||
|
||||
Reference in New Issue
Block a user