0
votes

I have single pipeline that runs based on a commit to main. Main contains a folder with IaC Modules. When a module is changed the pipeline will run.

The pipeline ships the module to a remote repo, but i have a problem where i need the pipeline to pickup the name of the module that's changed and name the artefact that gets shipped with the name of the module. I can't find a way to do this.

I've think i need to define a variable in the pipeline like: name: filename value: something to get the name of the module But not sure what the value needs to be?

Thanks

1

1 Answers

0
votes

You can use the pre-defined variable Build.SourceVersion and retrieve changes by calling rest api https://docs.microsoft.com/en-us/rest/api/azure/devops/git/commits/get%20changes?view=azure-devops-rest-6.0 for that commit - then parse the changes and find the file/folder change in commit - which can be used to determine the module changed