@@ -79,6 +79,7 @@ def _build_contribution_graph_from_git(repo_path: str = ".") -> list:
7979 result = subprocess .run (
8080 ['git' , 'log' , '--pretty=format:%ai' , '--all' ],
8181 capture_output = True , text = True , cwd = repo_path ,
82+ env = {** os .environ , 'GH_TOKEN' : os .getenv ('GH_TOKEN' )}
8283 )
8384 if result .returncode != 0 :
8485 return []
@@ -216,7 +217,7 @@ def _gh_api(self, endpoint: str, method: str = "GET") -> Any:
216217 capture_output = True ,
217218 text = True ,
218219 timeout = 30 ,
219- env = {'GH_TOKEN' : self . token } if self . token != None else { }
220+ env = {** os . environ , 'GH_TOKEN' : os . getenv ( 'GH_TOKEN' ) }
220221 )
221222 if result .returncode != 0 :
222223 raise Exception (f"gh api failed: { result .stderr } " )
@@ -441,7 +442,7 @@ def _search_items(self, query: str, per_page: int = 5) -> Dict[str, Any]:
441442 capture_output = True ,
442443 text = True ,
443444 timeout = 30 ,
444- env = {'GH_TOKEN' : self . token } if self . token != None else { }
445+ env = {** os . environ , 'GH_TOKEN' : os . getenv ( 'GH_TOKEN' ) }
445446 )
446447 if result .returncode != 0 :
447448 return {'total_count' : 0 , 'items' : []}
@@ -553,7 +554,7 @@ def _fetch_contribution_graph(self, username: str) -> list:
553554 capture_output = True ,
554555 text = True ,
555556 timeout = 30 ,
556- env = {'GH_TOKEN' : self . token } if self . token != None else { }
557+ env = {** os . environ , 'GH_TOKEN' : os . getenv ( 'GH_TOKEN' ) }
557558 )
558559
559560 if result .returncode != 0 :
@@ -646,6 +647,7 @@ def _api_request(self, endpoint: str) -> Any:
646647 capture_output = True ,
647648 text = True ,
648649 timeout = 30 ,
650+ env = {** os .environ , 'GH_TOKEN' : os .getenv ('GH_TOKEN' )}
649651 )
650652 if result .returncode != 0 :
651653 raise Exception (f"API request failed: { result .stderr } " )
0 commit comments