@@ -28,11 +28,11 @@ def get_changes(self, force=False):
2828 if self ._changes_cache and not force :
2929 return self ._changes_cache
3030 # URL for the GitLab API endpoint
31- url = f"{ gitlab_server_url } /api/v4/projects/{ self .project_id } /merge_requests/{ self .iid } /changes"
31+ url = f"{ GITLAB_SERVER_URL } /api/v4/projects/{ self .project_id } /merge_requests/{ self .iid } /changes"
3232
3333 # Headers for the request
3434 headers = {
35- "PRIVATE-TOKEN" : gitlab_private_token
35+ "PRIVATE-TOKEN" : GITLAB_PRIVATE_TOKEN
3636 }
3737
3838 # Make the GET request
@@ -58,11 +58,11 @@ def get_file_content(self, file_path, branch_name='main', force=False):
5858 if file_path in self ._file_content_cache and not force :
5959 return self ._file_content_cache [file_path ]
6060 # URL for the GitLab API endpoint
61- url = f"{ gitlab_server_url } /api/v4/projects/{ self .project_id } /repository/files/{ file_path } /raw?ref={ branch_name } "
61+ url = f"{ GITLAB_SERVER_URL } /api/v4/projects/{ self .project_id } /repository/files/{ file_path } /raw?ref={ branch_name } "
6262
6363 # Headers for the request
6464 headers = {
65- "PRIVATE-TOKEN" : gitlab_private_token
65+ "PRIVATE-TOKEN" : GITLAB_PRIVATE_TOKEN
6666 }
6767
6868 # Make the GET request
@@ -84,11 +84,11 @@ def get_info(self, force=False):
8484 if self ._info_cache and not force :
8585 return self ._info_cache
8686 # URL for the GitLab API endpoint
87- url = f"{ gitlab_server_url } /api/v4/projects/{ self .project_id } /merge_requests/{ self .iid } "
87+ url = f"{ GITLAB_SERVER_URL } /api/v4/projects/{ self .project_id } /merge_requests/{ self .iid } "
8888
8989 # Headers for the request
9090 headers = {
91- "PRIVATE-TOKEN" : gitlab_private_token
91+ "PRIVATE-TOKEN" : GITLAB_PRIVATE_TOKEN
9292 }
9393
9494 # Make the GET request
@@ -115,11 +115,11 @@ def get_info(self):
115115 :return: Project information
116116 """
117117 # URL for the GitLab API endpoint
118- url = f"{ gitlab_server_url } /api/v4/projects/{ self .project_id } "
118+ url = f"{ GITLAB_SERVER_URL } /api/v4/projects/{ self .project_id } "
119119
120120 # Headers for the request
121121 headers = {
122- "PRIVATE-TOKEN" : gitlab_private_token
122+ "PRIVATE-TOKEN" : GITLAB_PRIVATE_TOKEN
123123 }
124124
125125 # Make the GET request
@@ -195,7 +195,7 @@ def find_files_by_keyword(self, keyword, branch_name="main"):
195195 # 构建带有身份验证信息的 URL
196196 def _build_authenticated_url (self , repo_url ):
197197 # 如果 URL 使用 https
198- token = gitlab_private_token
198+ token = GITLAB_PRIVATE_TOKEN
199199 if repo_url .startswith ("https://" ):
200200 return f"https://oauth2:{ token } @{ repo_url [8 :]} "
201201 # 如果 URL 使用 http
0 commit comments