fix: set GITEA_PUSH_VERIFIED for post-receive hook too
This commit is contained in:
@@ -136,11 +136,13 @@ def _trigger_gitea_post_receive(changed: list, gitea_cfg):
|
|||||||
try:
|
try:
|
||||||
config_path = os.environ.get("GITEA_CONFIG", "/etc/gitea/app.ini")
|
config_path = os.environ.get("GITEA_CONFIG", "/etc/gitea/app.ini")
|
||||||
lines = "\n".join(f"{o} {n} {r}" for o, n, r in changed)
|
lines = "\n".join(f"{o} {n} {r}" for o, n, r in changed)
|
||||||
|
hook_env = {**os.environ, "GITEA_PUSH_VERIFIED": "1"}
|
||||||
r = subprocess.run(
|
r = subprocess.run(
|
||||||
[hook_bin, "hook", "--config", config_path, "post-receive"],
|
[hook_bin, "hook", "--config", config_path, "post-receive"],
|
||||||
input=lines.encode(),
|
input=lines.encode(),
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
timeout=60,
|
timeout=60,
|
||||||
|
env=hook_env,
|
||||||
)
|
)
|
||||||
if r.returncode != 0:
|
if r.returncode != 0:
|
||||||
err = (r.stderr or b"").decode(errors="replace").strip()
|
err = (r.stderr or b"").decode(errors="replace").strip()
|
||||||
|
|||||||
Reference in New Issue
Block a user