File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/aieng_bot_maintain/auto_merger Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 11"""Workflow client for GitHub operations via gh CLI."""
22
33import json
4+ import os
45import subprocess
56import tempfile
67import time
@@ -67,12 +68,16 @@ def _run_gh_command(self, cmd: list[str]) -> str:
6768 If command fails.
6869
6970 """
71+ # Inherit environment and add GH_TOKEN
72+ env = os .environ .copy ()
73+ env ["GH_TOKEN" ] = self .gh_token
74+
7075 result = subprocess .run (
7176 cmd ,
7277 capture_output = True ,
7378 text = True ,
7479 check = True ,
75- env = { "GH_TOKEN" : self . gh_token } ,
80+ env = env ,
7681 )
7782 return result .stdout .strip ()
7883
@@ -239,6 +244,10 @@ def _manual_rebase(self, pr: PRQueueItem) -> bool:
239244 with tempfile .TemporaryDirectory () as tmpdir :
240245 repo_dir = Path (tmpdir ) / "repo"
241246
247+ # Inherit environment and add GH_TOKEN for all git operations
248+ env = os .environ .copy ()
249+ env ["GH_TOKEN" ] = self .gh_token
250+
242251 # Clone the repository
243252 log_info (f" Cloning { pr .repo } ..." )
244253 subprocess .run (
@@ -253,7 +262,7 @@ def _manual_rebase(self, pr: PRQueueItem) -> bool:
253262 ],
254263 check = True ,
255264 capture_output = True ,
256- env = { "GH_TOKEN" : self . gh_token } ,
265+ env = env ,
257266 )
258267
259268 # Configure git user for commits
You can’t perform that action at this time.
0 commit comments