3
votes

I'm trying to add my build status to GitHub readme file, but I cannot figure out where to find {guid} and {id} of my build.

Here is documentation: https://docs.microsoft.com/en-us/vsts/build-release/actions/ci-build-github#create-a-vsts-build-status-with-a-github-readme-file

Image tag for status:

[<img
src="https://{your-account}.visualstudio.com/_apis/public/build/definitions/{guid}/{id}/badge"/>](https://{your-account}.visualstudio.com/{your-project}/_build/index?definitionId={id})
2

2 Answers

8
votes

You need to enable Badge in the build definition:

  1. Edit your build definition
  2. Select Options tab
  3. Check Badge enabled checkbox
  4. Save build definition
  5. The URL will be generated

enter image description here

0
votes

You can just put a link to the build definition results page, whatever you find in the web, that link will allow you to click from GitHub and go to the right place in VSTS and definition ID will show up in query parameters in the browser URL when you use VSTS UI.

Also, you can use API.Check the below document for more information.

https://www.visualstudio.com/en-us/docs/integrate/api/build/builds