mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
hotfix(Secrets): Add event stream filter for refreshed secret (#6764)
This commit is contained in:
parent
57391d6e66
commit
14ee6d7afe
@ -282,6 +282,9 @@ class EventStream:
|
||||
def set_secrets(self, secrets: dict[str, str]):
|
||||
self.secrets = secrets.copy()
|
||||
|
||||
def update_secrets(self, secrets: dict[str, str]):
|
||||
self.secrets.update(secrets)
|
||||
|
||||
def _replace_secrets(self, data: dict) -> dict:
|
||||
for key in data:
|
||||
if isinstance(data[key], dict):
|
||||
|
||||
@ -225,6 +225,13 @@ class Runtime(FileEditRuntimeMixin):
|
||||
export_cmd = CmdRunAction(
|
||||
f"export GITHUB_TOKEN='{token.get_secret_value()}'"
|
||||
)
|
||||
|
||||
self.event_stream.update_secrets(
|
||||
{
|
||||
'github_token': token.get_secret_value(),
|
||||
}
|
||||
)
|
||||
|
||||
await call_sync_from_async(self.run, export_cmd)
|
||||
|
||||
observation: Observation = await call_sync_from_async(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user