1

As the title says, I’m working on a custom DevOps task that begins with navigating in the repository to an XML file from a file path. Then processes the XML file and saves the changes.

Now I’ve tried looking on google and through Microsoft’s own documentation. Where I found built-in tasks that do navigate the repo, retrieves an XML file, do stuff to it and save it. However, when looking at the task in GitHub, the pre-existing tasks rely on a library that is only internal and not available on npm.

Does anyone know how to retrieve an XML file from a file path in TypeScript?

  • What's kind of tasking are you developing with? Build, utility, test, package, deploy or others? Also would you mind sharing the built-in task you are found? For the retrieve an XML file from file path(local), you can refer the [read-xml](https://www.npmjs.com/package/read-xml). – Fei Xue Dec 25 '19 at 06:29
  • @FeiXue-MSFT Release task https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/ExtractFilesV1 https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/FileTransformV1 – ZookTheMagpie Jan 03 '20 at 09:38

1 Answers1

0

The FileTransformV1 you mentioned is using the webdeployment-common-v2 to replace the string in the xml or json file which is open source. And the azure-pipelines-tasks project is under MIT License (MIT), you can develop with this source code if you agree it.

Another way is you can develop with webdeployment-common instead of version 2 since this package is already published to NPM site.

And if you also like webdeployment-common-v2 to be published, you can raise the feedback on the azure-pipelines-task GitHub.

Fei Xue
  • 14,369
  • 1
  • 19
  • 27
  • Maybe you know how to answer this one as well? https://stackoverflow.com/questions/68064726/how-to-get-an-external-file-path-in-an-azure-pipeline-task – CodeMonkey Jun 23 '21 at 06:51