mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Fix runtime to call new token refresh (#7084)
This commit is contained in:
parent
3d38a105cf
commit
4e4f4d64f8
@ -51,6 +51,9 @@ class GitHubService:
|
||||
async def get_latest_token(self) -> SecretStr:
|
||||
return self.token
|
||||
|
||||
async def get_latest_provider_token(self) -> SecretStr:
|
||||
return self.token
|
||||
|
||||
async def _fetch_data(
|
||||
self, url: str, params: dict | None = None
|
||||
) -> tuple[Any, dict]:
|
||||
|
||||
@ -222,7 +222,7 @@ class Runtime(FileEditRuntimeMixin):
|
||||
if isinstance(event, CmdRunAction):
|
||||
if self.github_user_id and '$GITHUB_TOKEN' in event.command:
|
||||
gh_client = GithubServiceImpl(user_id=self.github_user_id)
|
||||
token = await gh_client.get_latest_token()
|
||||
token = await gh_client.get_latest_provider_token()
|
||||
if token:
|
||||
export_cmd = CmdRunAction(
|
||||
f"export GITHUB_TOKEN='{token.get_secret_value()}'"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user