Public Access
DEVX-168: fix(ci): handle list-shaped ref response in create_dependency_pr
This commit was merged in pull request #334.
This commit is contained in:
@@ -345,6 +345,12 @@ def cli(
|
||||
# Create branch via API
|
||||
try:
|
||||
master_ref = client._request("GET", "/git/refs/heads/master").json()
|
||||
# Implements: REQ-1 — Gitea returns a list of matching refs
|
||||
if isinstance(master_ref, list):
|
||||
master_ref = next(
|
||||
(r for r in master_ref if r.get("ref") == "refs/heads/master"),
|
||||
master_ref[0] if master_ref else {},
|
||||
)
|
||||
master_sha = master_ref.get("object", {}).get("sha", "")
|
||||
if not master_sha:
|
||||
raise click.ClickException("Could not get master SHA")
|
||||
|
||||
Reference in New Issue
Block a user