Skip to content

Commit

Permalink
fix github repo url issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sydowma committed Oct 4, 2024
1 parent 980e6f4 commit b7a0b7b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"GITLAB_URL": "your_gitlab_url",
"GITLAB_TOKEN": "your_gitlab_token",
"GITHUB_TOKEN": "your_github_token",
"GITHUB_REPO_URL": "your_github_repo_url",
"OPENAI_API_KEY": "your_openai_api_key",
"OPENAI_HTTP_PROXY": "your_http_proxy_if_any"
"OPENAI_HTTP_PROXY": "",
"AI_PROVIDER": "openai",
"MODEL": "gpt-4o"
}
3 changes: 2 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def load_config(config_path=DEFAULT_CONFIG_PATH, env_file=DEFAULT_ENV_FILE):
config = {
"GITLAB_URL": "",
"GITLAB_TOKEN": "",
"GITHUB_REPO_URL": "",
"GITHUB_TOKEN": "",
"OPENAI_API_KEY": "",
"OPENAI_HTTP_PROXY": "",
Expand Down Expand Up @@ -464,7 +465,7 @@ def get_body(self, pr: PullRequest) -> str:

def review_last_pull_request(self):
global LATEST_PULL_REQUEST_NUMBER
pull_requests = self.gh.get_repo(GITLAB_URL).get_pulls(state='open', sort='created', direction='desc')
pull_requests = self.gh.get_repo(config['GITHUB_REPO_URL']).get_pulls(state='open', sort='created', direction='desc')
if LATEST_PULL_REQUEST_NUMBER == 0:
LATEST_PULL_REQUEST_NUMBER = pull_requests[0].number
logger.info(f"Set latest pull request number to {LATEST_PULL_REQUEST_NUMBER}")
Expand Down

0 comments on commit b7a0b7b

Please sign in to comment.