Skip to content

Commit 30f2ce3

Browse files
committed
Fix manual rebase workflow
1 parent ee69d51 commit 30f2ce3

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/aieng_bot_maintain/auto_merger/workflow_client.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Workflow client for GitHub operations via gh CLI."""
22

33
import json
4+
import os
45
import subprocess
56
import tempfile
67
import 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

0 commit comments

Comments
 (0)