Andrija
Andrija

Reputation: 14487

Adding VSTS build status to GitHub page

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://learn.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})

Upvotes: 3

Views: 1584

Answers (2)

starian chen-MSFT
starian chen-MSFT

Reputation: 33738

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

Upvotes: 8

Sheethal J S
Sheethal J S

Reputation: 430

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

Upvotes: 0

Related Questions