mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
Ensure Lokalise download runs as the same user as GitHub Actions (#149026)
This commit is contained in:
parent
916b4368dd
commit
3877a6211a
@ -4,6 +4,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -20,13 +21,15 @@ DOWNLOAD_DIR = Path("build/translations-download").absolute()
|
|||||||
def run_download_docker():
|
def run_download_docker():
|
||||||
"""Run the Docker image to download the translations."""
|
"""Run the Docker image to download the translations."""
|
||||||
print("Running Docker to download latest translations.")
|
print("Running Docker to download latest translations.")
|
||||||
run = subprocess.run(
|
result = subprocess.run(
|
||||||
[
|
[
|
||||||
"docker",
|
"docker",
|
||||||
"run",
|
"run",
|
||||||
"-v",
|
"-v",
|
||||||
f"{DOWNLOAD_DIR}:/opt/dest/locale",
|
f"{DOWNLOAD_DIR}:/opt/dest/locale",
|
||||||
"--rm",
|
"--rm",
|
||||||
|
"--user",
|
||||||
|
f"{os.getuid()}:{os.getgid()}",
|
||||||
f"lokalise/lokalise-cli-2:{CLI_2_DOCKER_IMAGE}",
|
f"lokalise/lokalise-cli-2:{CLI_2_DOCKER_IMAGE}",
|
||||||
# Lokalise command
|
# Lokalise command
|
||||||
"lokalise2",
|
"lokalise2",
|
||||||
@ -52,7 +55,7 @@ def run_download_docker():
|
|||||||
)
|
)
|
||||||
print()
|
print()
|
||||||
|
|
||||||
if run.returncode != 0:
|
if result.returncode != 0:
|
||||||
raise ExitApp("Failed to download translations")
|
raise ExitApp("Failed to download translations")
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user