I have a custom build step that fails under certain conditions during my Pull Request build, within Azure DevOps.
I would like to extend it further by raising a PR comment, similar to this sort of thing in GitHub: https://developer.github.com/v3/issues/comments/#create-a-comment
I don't have code samples to add here as I could not find useful examples to build upon. I use PowerShell for my custom build step - how do I achieve this when running a PR build of my branch?
I can help with an example. There is a bunch of value in posting custom messages\status to PRs from your pipelines.
First things first, make sure your build service has permissions to contribute to pull requests in your repository.
Then you want to add a conditional PowerShell step. This one is just based on it being a PR build, but you might want to add a depends on failure for the previous step, based on your workflow.
So the basic workflow is:
PostToPR.ps1
And you end up with a nice markdown table with custom status information in your PR!