Skip to content

[Bug]: build-deploy exports outputPath, redirecting every project's MSBuild OutputPath #45

Closed

Description

@ncipollina

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

  1. Call build-deploy.yaml from a repository whose solution has several projects, including test projects with their own appsettings.json, with hasTests: true.
  2. Open the test step's log: test assemblies run from …/publish/<TFM>/… rather than …/<project>/bin/<Configuration>/<TFM>/….
  3. 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

  1. added
    🐛 bug
    on Oct 14, 2026
  2. added a commit that references this issue on Oct 14, 2026
    9897863
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions