如何在 GitHub 上托管的 README.md 文件中显示 VSTS Build Badge?

How to display a VSTS Build Badge in a README.md file hosted on GitHub?

我开发了一个小型库,我选择在 GitHub 上托管它。代码由 VSTS 构建构建并作为 NuGet 包发布。

我已经写了一个 README.md 文件,我正在尝试在其中包含一个构建标志,如 Microsoft documentation 中所述。因此,我在 MD 文件中添加了以下行并相应地替换了占位符:

![Build status](https://{my-organisation}.visualstudio.com/{my-project}/_apis/build/status/{my-build-definition-name}?branch=master)

问题是没有登录 VSTS 的任何人都无法访问 link,最后我的 [=16= 上出现 'broken' link ] 页面:

问题

必须做什么才能使 VSTS Build Badge 可用于 GitHub 存储库?

我想您必须包含某种身份验证令牌,以便至少可以从您的 GitHub 页面读取 VSTS 构建。

注意 the documentation lists also multiple pending issues, including MicrosoftDocs/vsts-docs issue 1499:

Build status badge added to GitHub readme doesn't show up.

所以这还在进行中。

关于最后一期,它说:

This is due to public vs. private projects.
If you make your project public the image URL will render.
There are other potential workarounds we are looking at for the doc.

参见“Change the project visibility, public or private”。