diff --git a/.github/workflows/api-docs.yml b/.github/workflows/api-docs.yml index 77919db..6aadbbb 100644 --- a/.github/workflows/api-docs.yml +++ b/.github/workflows/api-docs.yml @@ -190,14 +190,20 @@ jobs: # .csproj files are usually /.csproj # but DefaultDocumentation expects the assembly name as the # output dir, so search for a .csproj matching the project. + # Some projects have multiple matching .csproj files (e.g. + # both `/.csproj` and + # `packages//.csproj`); only the packaging + # variant has . Scan all candidates and return + # the first one that yields a real version, so we don't + # show "unknown" just because the first match happens + # to be the bare assembly project. candidates = list(pathlib.Path(".").rglob(f"{proj}.csproj")) - if not candidates: - return "unknown" - text = candidates[0].read_text(encoding="utf-8") - for tag in ("Version", "VersionPrefix"): - m = re.search(rf"<{tag}>([^<]+)", text) - if m: - return m.group(1).strip() + for cand in candidates: + text = cand.read_text(encoding="utf-8") + for tag in ("Version", "VersionPrefix"): + m = re.search(rf"<{tag}>([^<]+)", text) + if m: + return m.group(1).strip() return "unknown" print("# ResQ .NET SDK")