Adding Status Badges

This document describes how to create a badge that displays your project’s build status (passed or failed) in a README or other document.


Status badges are commonly embedded in project READMEs, although they can be placed in any web document. CircleCI provides a tool to generate embed code for status badges. By default, a badge displays the status of a project’s default branch, though you can also display the status of specific branches.

You can generate code for the following formats:

  • 图像网址
  • 啰嗦
  • 纺织品
  • rdoc.
  • AsciiDoc
  • 重组修改
  • pod


To generate your own status badge, you will need to know and substitute the following variables in the code snippets below:

  • - 您的项目名称。例:Circleci.-docs
  • - The organization or user name the project in question belongs to.
  • - 您的VCS提供商(ghfor “github” andbbfor BitBucket).
  • - The link you want the status badge to go to when clicked (example: the pipeline overview page).
  • 可选:API令牌(为私人项目创建徽章)。


# Template: [![](//]() # Example: [![CircleCI](//](// # Example for specific branch: [![CircleCI](//](//
# Template: !//!: # Example: !//!:// # Example for specific branch: !//!://
#template:{/uteg_name>/< project_name> .svg?style=svg”alt =“”/>} [https://Circleci.。com/gh//] # Example: {CircleCI}[//] # Example for specific branch: {CircleCI}[//]
#模板:图片:  /  /  .svg?style = svg [“”,link =“// /  / “]#示例:图片: = svg [”circleci“,link =”https:// circleci。com/gh/circleci/circleci-docs"] # Example for specific branch: image://["CircleCI", link="//"]
# Template: .. image:: // :target: // # Example: .. image:: // :target: // # Example for specific branch: .. image:: // :target: //
#template:=对于html   #特定分支的示例:=对于html   


注意:To create a status badge for a private project you will need to create anapi tokenspecifically scoped to “status”并在徽章的URL字符串中包含该标记。考虑下面的Markdown Image徽章片段,针对上面的原始标记示例;它有一个添加令牌的URL参数。


To create a status api token, go to yourProject’s Settings(present on the top right corner) >API权限and create a token scoped toStatus


If you find the default status badge too minimal, you can use theshield style。使用屏蔽风格,更换style = svg.风格=盾在您在上面生成的链接中。



Passing shield version

Failing shield version

See also