Public Access
DEVX-162: fix: read Gitea repo-variable data field; fail closed on unknown nightly status
This commit was merged in pull request #319.
This commit is contained in:
@@ -392,7 +392,10 @@ class GiteaClient:
|
||||
"""
|
||||
try:
|
||||
r = self._request("GET", f"/actions/variables/{name}")
|
||||
return r.json().get("value")
|
||||
body = r.json()
|
||||
if "data" in body:
|
||||
return body["data"]
|
||||
return body.get("value")
|
||||
except APIError as e:
|
||||
if e.status == 404:
|
||||
return None
|
||||
|
||||
@@ -97,10 +97,17 @@ def cli(repo: str, action: str, run_id: str, github_output: bool) -> None:
|
||||
write_github_output("nightly-status", status)
|
||||
raise click.ClickException(_("Nightly gate failed — staging deploy blocked."))
|
||||
else:
|
||||
click.echo(f"[nightly-gate] Unknown nightly status: {status} — allowing deploy.")
|
||||
click.echo(
|
||||
_(
|
||||
"[nightly-gate] Unknown nightly status: {status} — blocking deploy (fail closed).",
|
||||
status=status,
|
||||
),
|
||||
err=True,
|
||||
)
|
||||
if github_output:
|
||||
write_github_output("nightly-gate-passed", "true")
|
||||
write_github_output("nightly-gate-passed", "false")
|
||||
write_github_output("nightly-status", status)
|
||||
raise click.ClickException(_("Unknown nightly status — staging deploy blocked."))
|
||||
|
||||
elif action == "set-passed":
|
||||
set_nightly_status(client, f"passed:{run_id}" if run_id else "passed")
|
||||
|
||||
+1836
-2846
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user