fix: set GITEA_PUSH_VERIFIED for post-receive hook too

This commit is contained in:
2026-06-24 13:49:08 +02:00
parent 7ae008717f
commit 324ec60c8c
+2
View File
@@ -136,11 +136,13 @@ def _trigger_gitea_post_receive(changed: list, gitea_cfg):
try:
config_path = os.environ.get("GITEA_CONFIG", "/etc/gitea/app.ini")
lines = "\n".join(f"{o} {n} {r}" for o, n, r in changed)
hook_env = {**os.environ, "GITEA_PUSH_VERIFIED": "1"}
r = subprocess.run(
[hook_bin, "hook", "--config", config_path, "post-receive"],
input=lines.encode(),
capture_output=True,
timeout=60,
env=hook_env,
)
if r.returncode != 0:
err = (r.stderr or b"").decode(errors="replace").strip()