Skip to content

Commit 2356ccf

Browse files
authored
Merge pull request #2 from alalkamys/fix/is-open-pr
fix: missing github_enterprise token
2 parents 0c70249 + ebeed30 commit 2356ccf

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/helpers/scm_providers_operations.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,16 @@ def is_open_pull_requests(repo: Repo, pull_request_config: dict[str, dict[str, A
8282

8383
elif scm_provider_type == "github":
8484
_logger.info("GitHub pull request detected.")
85-
GITHUB_TOKEN = app_config.GITHUB_TOKEN
85+
domain = scm_provider_data['domain'].strip()
86+
87+
GITHUB_TOKEN = app_config.GITHUB_TOKEN if domain == "github.com" else app_config.GITHUB_ENTERPRISE_TOKEN
8688

8789
if not GITHUB_TOKEN:
8890
_logger.error(
89-
"GitHub API Key not found. Please set 'GITHUB_TOKEN' environment variable with your GitHub Personal Access Token (PAT) before running Code Migration Assistant")
91+
"GitHub API Key not found. Please set 'GITHUB_TOKEN' environment variable for with your GitHub Personal Access Token (PAT) or set 'GITHUB_ENTERPRISE_TOKEN' for GitHub Enterprise before running Code Migration Assistant")
9092
_logger.info("Aborting..")
9193
return False
9294

93-
domain = scm_provider_data['domain'].strip()
9495
base_url = "https://api.github.com" if domain == "github.com" else "https://" + \
9596
domain + "/api/v3"
9697
repo_name = os.path.basename(

0 commit comments

Comments
 (0)