0

I have a solution with two projects.

Integration.Api
Integration.Common

In Azure DevOps, I have steps which run for the Integration.Api project, I also have these build steps to create a NuGet package for the Integration.Common project:

dotnet Pack Common
dotnet Nuget Push

What do I put in the Custom condition textbox so that the step runs only if the Integration.Common project has changed? ie. I still want the build to run if Integration.Api has changed, but I only want the dotnet Pack steps to run if Integration.Common has changed. Azure DevOps

David Klempfner
  • 8,700
  • 20
  • 73
  • 153

2 Answers2

1

What do I put in the Custom condition textbox so that the step runs only if the Integration.Common project has changed?

There is no such out of box expressions.

But you can use a powershell script to pull out the modified files, and enables the corresponding variables, then add expressions in the custom condition textbox based on the value of variables.

Ticket: Conditional build solution in Azure DevOps

Hope this helps.

Community
  • 1
  • 1
Leo Liu
  • 71,098
  • 10
  • 114
  • 135
0

Pretty sure you'd need to put condition on build, not on step. Put such a trigger condition on the build where you want to build common components.

trigger:
  paths:
    include:
    - /path/to/common/*

https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema?view=azure-devops&tabs=schema#triggers

4c74356b41
  • 69,186
  • 6
  • 100
  • 141