From de4a34465df0e59feb1551d423fd4519396cdd9f Mon Sep 17 00:00:00 2001 From: Xavier <1859710+xavierjohn@users.noreply.github.com> Date: Sun, 5 Jul 2026 18:19:58 -0700 Subject: [PATCH 1/4] Write API reference docs to the nearest .github, not the repo root The packed Trellis.ApiReference.targets copied the API-reference markdown to /.github on build. In a repository whose subfolders are themselves projects (each with its own .github), building a subproject dumped the docs at the outer repo root instead of the subproject's own .github. Walk up from the project directory and copy to the NEAREST existing .github, bounded so the search never crosses above the .git repository root (so it cannot escape into an unrelated parent). If no .github exists between the project and the repo root, fall back to creating .github at the repo root - the previous behavior for a normal single-repo consumer. The TrellisApiReferenceRoot override is unchanged. --- build/Trellis.ApiReference.targets | 70 +++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/build/Trellis.ApiReference.targets b/build/Trellis.ApiReference.targets index 3378a15..bf8787a 100644 --- a/build/Trellis.ApiReference.targets +++ b/build/Trellis.ApiReference.targets @@ -2,8 +2,9 @@ - <_TrellisRepoRoot>$(TrellisApiReferenceRoot) + <_TrellisApiOutputDir>$([MSBuild]::EnsureTrailingSlash($([System.IO.Path]::Combine('$(TrellisApiReferenceRoot)', '.github')))) - + <_Tp0>$(MSBuildProjectDirectory) <_Tp1>$([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine('$(_Tp0)', '..')))) <_Tp2>$([System.IO.Path]::GetFullPath($([System.IO.Path]::Combine('$(_Tp1)', '..')))) @@ -72,10 +77,55 @@ <_TrellisRepoRoot Condition="'$(_TrellisRepoRoot)' == '' AND Exists('$(_Tp8Git)')">$(_Tp8) <_TrellisRepoRoot Condition="'$(_TrellisRepoRoot)' == '' AND Exists('$(_Tp9Git)')">$(_Tp9) <_TrellisRepoRoot Condition="'$(_TrellisRepoRoot)' == '' AND Exists('$(_Tp10Git)')">$(_Tp10) + + + <_Tp0GitHub>$([System.IO.Path]::Combine('$(_Tp0)', '.github')) + <_Tp1GitHub>$([System.IO.Path]::Combine('$(_Tp1)', '.github')) + <_Tp2GitHub>$([System.IO.Path]::Combine('$(_Tp2)', '.github')) + <_Tp3GitHub>$([System.IO.Path]::Combine('$(_Tp3)', '.github')) + <_Tp4GitHub>$([System.IO.Path]::Combine('$(_Tp4)', '.github')) + <_Tp5GitHub>$([System.IO.Path]::Combine('$(_Tp5)', '.github')) + <_Tp6GitHub>$([System.IO.Path]::Combine('$(_Tp6)', '.github')) + <_Tp7GitHub>$([System.IO.Path]::Combine('$(_Tp7)', '.github')) + <_Tp8GitHub>$([System.IO.Path]::Combine('$(_Tp8)', '.github')) + <_Tp9GitHub>$([System.IO.Path]::Combine('$(_Tp9)', '.github')) + <_Tp10GitHub>$([System.IO.Path]::Combine('$(_Tp10)', '.github')) + + + <_NoGitLt0>true + <_NoGitLt1 Condition="'$(_NoGitLt0)' == 'true' AND !Exists('$(_Tp0Git)')">true + <_NoGitLt2 Condition="'$(_NoGitLt1)' == 'true' AND !Exists('$(_Tp1Git)')">true + <_NoGitLt3 Condition="'$(_NoGitLt2)' == 'true' AND !Exists('$(_Tp2Git)')">true + <_NoGitLt4 Condition="'$(_NoGitLt3)' == 'true' AND !Exists('$(_Tp3Git)')">true + <_NoGitLt5 Condition="'$(_NoGitLt4)' == 'true' AND !Exists('$(_Tp4Git)')">true + <_NoGitLt6 Condition="'$(_NoGitLt5)' == 'true' AND !Exists('$(_Tp5Git)')">true + <_NoGitLt7 Condition="'$(_NoGitLt6)' == 'true' AND !Exists('$(_Tp6Git)')">true + <_NoGitLt8 Condition="'$(_NoGitLt7)' == 'true' AND !Exists('$(_Tp7Git)')">true + <_NoGitLt9 Condition="'$(_NoGitLt8)' == 'true' AND !Exists('$(_Tp8Git)')">true + <_NoGitLt10 Condition="'$(_NoGitLt9)' == 'true' AND !Exists('$(_Tp9Git)')">true + + + <_TrellisNearestGitHub Condition="'$(_NoGitLt0)' == 'true' AND Exists('$(_Tp0GitHub)')">$(_Tp0GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt1)' == 'true' AND Exists('$(_Tp1GitHub)')">$(_Tp1GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt2)' == 'true' AND Exists('$(_Tp2GitHub)')">$(_Tp2GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt3)' == 'true' AND Exists('$(_Tp3GitHub)')">$(_Tp3GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt4)' == 'true' AND Exists('$(_Tp4GitHub)')">$(_Tp4GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt5)' == 'true' AND Exists('$(_Tp5GitHub)')">$(_Tp5GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt6)' == 'true' AND Exists('$(_Tp6GitHub)')">$(_Tp6GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt7)' == 'true' AND Exists('$(_Tp7GitHub)')">$(_Tp7GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt8)' == 'true' AND Exists('$(_Tp8GitHub)')">$(_Tp8GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt9)' == 'true' AND Exists('$(_Tp9GitHub)')">$(_Tp9GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt10)' == 'true' AND Exists('$(_Tp10GitHub)')">$(_Tp10GitHub) - - <_TrellisApiOutputDir Condition="'$(_TrellisRepoRoot)' != ''">$([MSBuild]::EnsureTrailingSlash($([System.IO.Path]::Combine('$(_TrellisRepoRoot)', '.github')))) + + <_TrellisApiOutputDir Condition="'$(_TrellisNearestGitHub)' != ''">$([MSBuild]::EnsureTrailingSlash('$(_TrellisNearestGitHub)')) + <_TrellisApiOutputDir Condition="'$(_TrellisApiOutputDir)' == '' AND '$(_TrellisRepoRoot)' != ''">$([MSBuild]::EnsureTrailingSlash($([System.IO.Path]::Combine('$(_TrellisRepoRoot)', '.github')))) - <_TrellisNearestGitHub Condition="'$(_NoGitLt0)' == 'true' AND Exists('$(_Tp0GitHub)')">$(_Tp0GitHub) - <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt1)' == 'true' AND Exists('$(_Tp1GitHub)')">$(_Tp1GitHub) - <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt2)' == 'true' AND Exists('$(_Tp2GitHub)')">$(_Tp2GitHub) - <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt3)' == 'true' AND Exists('$(_Tp3GitHub)')">$(_Tp3GitHub) - <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt4)' == 'true' AND Exists('$(_Tp4GitHub)')">$(_Tp4GitHub) - <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt5)' == 'true' AND Exists('$(_Tp5GitHub)')">$(_Tp5GitHub) - <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt6)' == 'true' AND Exists('$(_Tp6GitHub)')">$(_Tp6GitHub) - <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt7)' == 'true' AND Exists('$(_Tp7GitHub)')">$(_Tp7GitHub) - <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt8)' == 'true' AND Exists('$(_Tp8GitHub)')">$(_Tp8GitHub) - <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt9)' == 'true' AND Exists('$(_Tp9GitHub)')">$(_Tp9GitHub) - <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt10)' == 'true' AND Exists('$(_Tp10GitHub)')">$(_Tp10GitHub) + + <_TrellisNearestGitHub Condition="'$(_NoGitLt0)' == 'true' AND $([System.IO.Directory]::Exists('$(_Tp0GitHub)'))">$(_Tp0GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt1)' == 'true' AND $([System.IO.Directory]::Exists('$(_Tp1GitHub)'))">$(_Tp1GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt2)' == 'true' AND $([System.IO.Directory]::Exists('$(_Tp2GitHub)'))">$(_Tp2GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt3)' == 'true' AND $([System.IO.Directory]::Exists('$(_Tp3GitHub)'))">$(_Tp3GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt4)' == 'true' AND $([System.IO.Directory]::Exists('$(_Tp4GitHub)'))">$(_Tp4GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt5)' == 'true' AND $([System.IO.Directory]::Exists('$(_Tp5GitHub)'))">$(_Tp5GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt6)' == 'true' AND $([System.IO.Directory]::Exists('$(_Tp6GitHub)'))">$(_Tp6GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt7)' == 'true' AND $([System.IO.Directory]::Exists('$(_Tp7GitHub)'))">$(_Tp7GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt8)' == 'true' AND $([System.IO.Directory]::Exists('$(_Tp8GitHub)'))">$(_Tp8GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt9)' == 'true' AND $([System.IO.Directory]::Exists('$(_Tp9GitHub)'))">$(_Tp9GitHub) + <_TrellisNearestGitHub Condition="'$(_TrellisNearestGitHub)' == '' AND '$(_NoGitLt10)' == 'true' AND $([System.IO.Directory]::Exists('$(_Tp10GitHub)'))">$(_Tp10GitHub) - <_TrellisApiOutputDir Condition="'$(_TrellisNearestGitHub)' != ''">$([MSBuild]::EnsureTrailingSlash('$(_TrellisNearestGitHub)')) + + <_TrellisApiOutputDir Condition="'$(_TrellisRepoRoot)' != '' AND '$(_TrellisNearestGitHub)' != ''">$([MSBuild]::EnsureTrailingSlash('$(_TrellisNearestGitHub)')) <_TrellisApiOutputDir Condition="'$(_TrellisApiOutputDir)' == '' AND '$(_TrellisRepoRoot)' != ''">$([MSBuild]::EnsureTrailingSlash($([System.IO.Path]::Combine('$(_TrellisRepoRoot)', '.github')))) From 4c0a74bcd80d74751e585010e09363f92e57b162 Mon Sep 17 00:00:00 2001 From: Xavier <1859710+xavierjohn@users.noreply.github.com> Date: Sun, 5 Jul 2026 19:59:06 -0700 Subject: [PATCH 3/4] fix: update Microsoft.OpenApi to version 2.7.5 to address high-severity DoS vulnerability --- Directory.Packages.props | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Directory.Packages.props b/Directory.Packages.props index 36bd64d..ec91176 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -20,6 +20,12 @@ + + From c496ad87e2509caf0f9a5ceb469dd458cb09258d Mon Sep 17 00:00:00 2001 From: Xavier <1859710+xavierjohn@users.noreply.github.com> Date: Sun, 5 Jul 2026 20:06:09 -0700 Subject: [PATCH 4/4] # Enable central package transitive pinning Set CentralPackageTransitivePinningEnabled to true in Directory.Packages.props to allow overriding transitively-resolved package versions, enabling pinning of vulnerable dependencies to patched versions. --- Directory.Packages.props | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index ec91176..25d037f 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,4 +1,9 @@ - + + + + true +