Skip to content

Commit 3877a62

Browse files
authored
Ensure Lokalise download runs as the same user as GitHub Actions (home-assistant#149026)
1 parent 916b436 commit 3877a62

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

script/translations/download.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from __future__ import annotations
55

66
import json
7+
import os
78
from pathlib import Path
89
import re
910
import subprocess
@@ -20,13 +21,15 @@
2021
def run_download_docker():
2122
"""Run the Docker image to download the translations."""
2223
print("Running Docker to download latest translations.")
23-
run = subprocess.run(
24+
result = subprocess.run(
2425
[
2526
"docker",
2627
"run",
2728
"-v",
2829
f"{DOWNLOAD_DIR}:/opt/dest/locale",
2930
"--rm",
31+
"--user",
32+
f"{os.getuid()}:{os.getgid()}",
3033
f"lokalise/lokalise-cli-2:{CLI_2_DOCKER_IMAGE}",
3134
# Lokalise command
3235
"lokalise2",
@@ -52,7 +55,7 @@ def run_download_docker():
5255
)
5356
print()
5457

55-
if run.returncode != 0:
58+
if result.returncode != 0:
5659
raise ExitApp("Failed to download translations")
5760

5861

0 commit comments

Comments
 (0)