Displaying a sponsor button in your repository

You can add a sponsor button in your repository to increase the visibility of funding options for your open source project.

About FUNDING files

You can configure your sponsor button by editing a FUNDING.yml file in your repository's .github folder, on the default branch. You can configure the button to include sponsored developers in GitHub 赞助者, external funding platforms, or a custom funding URL. For more information about GitHub 赞助者, see "About GitHub Sponsors."

You can add one username, package name, or project name per external funding platform and up to four custom URLs. You can add up to four sponsored developers or organizations in GitHub 赞助者. Add each platform on a new line, using the following syntax:

PlatformSyntax
LFX Mentorship (formerly CommunityBridge)community_bridge: PROJECT-NAME
GitHub 赞助者github: USERNAME or github: [USERNAME, USERNAME, USERNAME, USERNAME]
IssueHuntissuehunt: USERNAME
Ko-fiko_fi: USERNAME
Liberapayliberapay: USERNAME
Open Collectiveopen_collective: USERNAME
Otechieotechie: USERNAME
Patreonpatreon: USERNAME
Tidelifttidelift: PLATFORM-NAME/PACKAGE-NAME
Custom URLcustom: LINK1 or custom: [LINK1, LINK2, LINK3, LINK4]

For Tidelift, use the platform-name/package-name syntax with the following platform names:

LanguagePlatform name
JavaScriptnpm
Pythonpypi
Rubyrubygems
Javamaven
PHPpackagist
C#nuget

Here's an example FUNDING.yml file:

github: [octocat, surftocat]
patreon: octocat
tidelift: npm/octo-package
custom: ["https://www.paypal.me/octocat", octocat.com]

Note: If a custom URL in an array includes :, you must wrap the URL in quotes. For example, "https://www.paypal.me/octocat".

You can create a default sponsor button for your organization or user account. For more information, see "Creating a default community health file."

Funding links provide a way for open source projects to receive direct financial support from their community. We don’t support the use of funding links for other purposes, such as for advertising, or supporting political, community, or charity groups. If you have questions about whether your intended use is supported, please contact GitHub 支持GitHub 高级支持.

Displaying a sponsor button in your repository

Anyone with admin permissions can enable a sponsor button in a repository.

  1. 在 GitHub 上,导航到仓库的主页面。
  2. 在仓库名称下,单击 Settings(设置)仓库设置按钮
  3. Under Features, select Sponsorships. Checkbox to enable Sponsorships
  4. Under "Sponsorships", click Set up sponsor button or Override funding links. Button to set up sponsor button
  5. In the file editor, follow the instructions in the FUNDING.yml file to add links to your funding locations. Edit the FUNDING file to add links to funding locations
  6. 在页面底部,输入一条简短、有意义的提交消息,描述您对文件所作的更改。 您可以在提交消息中将提交归于多个作者。 更多信息请参阅“创建有多个合作作者的提交”。 有关更改的提交消息
  7. 在提交消息字段下面,确定是要将提交添加到当前分支还是新分支。 如果当前分支是默认分支,则应选择为提交创建新分支,然后创建拉取请求。 更多信息请参阅“创建新的拉取请求”。 提交分支选项
  8. 单击 Propose new file(提议新文件)提议新文件按钮

Further reading

此文档对您有帮助吗?隐私政策

帮助我们创建出色的文档!

所有 GitHub 文档都是开源的。看到错误或不清楚的内容了吗?提交拉取请求。

做出贡献

或, 了解如何参与。