Repository navigation
Description
What happened?
build-deploy.yaml exposes its publish folder to every step as an environment variable named outputPath: a job-level env: outputPath: ${{ github.workspace }}/${{ inputs.outputPath }} (line 103) and echo "outputPath=…" >> $GITHUB_ENV in "Set Default Output Path If Not Provided" (lines 109/111).
MSBuild reads environment variables as properties, and property names are case-insensitive, so outputPath becomes MSBuild's OutputPath. Every dotnet restore/build/test in the job then builds every project in the solution into that one folder instead of each project's bin/<Configuration>/<TFM>. In a multi-project solution the projects overwrite each other's files (for example appsettings.json and dependency assemblies), and tests fail in ways unrelated to the code under test: hosts fail to start, wrong configuration is loaded, and responses become unexpected 500s.
Expected: each project builds to its own default output path; only the steps that deliberately publish or package (Blazor dotnet publish --output, Lambda packaging, SPA copy) use the publish folder.
The same defect existed in pr-build.yaml and was fixed in #44 (released in v11.0) by renaming the variable to TEMPLATE_OUTPUT_PATH. build-deploy.yaml still has it. Single-project solutions are unaffected, which is why it went unnoticed.
Steps to reproduce
- Call
build-deploy.yamlfrom a repository whose solution has several projects, including test projects with their ownappsettings.json, withhasTests: true. - Open the test step's log: test assemblies run from
…/publish/<TFM>/…rather than…/<project>/bin/<Configuration>/<TFM>/…. - Tests fail because files from different projects overwrote each other in the shared folder.
Reproduced with pr-build.yaml (same pattern) in sharedale/sharedale#97, run 38490027482: 7 unrelated test failures with assemblies running from /home/runner/work/sharedale/sharedale/publish/net11.0/. After #44's rename, the same solution passed with assemblies under each project's bin/Release/net11.0/ (run 38498479289).
Suggested fix: as in #44, rename the environment variable to TEMPLATE_OUTPUT_PATH (both the job-level env and the $GITHUB_ENV writes), and update every ${{ env.outputPath }} reference. Keep the outputPath input and composite-action input names unchanged.
Environment
GitHub-hosted ubuntu-latest / ubuntu-24.04-arm runners; LayeredCraft/devops-templates build-deploy.yaml through v11.0 (main at 5b2db86); .NET SDK 11.x; any multi-project solution.
Activity
feat(github): configurable build-deploy roles and separate MSBuild ou…