Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

❤️ This GitHub Action will automatically add your GitHub Sponsors to your README. It can be configured in multiple ways allowing you to display and breakdown your sponsors by price tier with fallbacks.

License

NotificationsYou must be signed in to change notification settings

JamesIves/github-sponsors-readme-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

✨ GitHub Sponsors Readme Action ✨

ThisGitHub Action will automatically add yourGitHub Sponsors to your README. It can be configured in multiple ways allowing you to display and breakdown your sponsors by price tier with fallbacks. It also includes templating support so you can display your sponsors how you'd like.

Maintenance of this project is made possible by all thecontributors andsponsors. If you'd like to sponsor this project and have your avatar or company logo appear belowclick here. 💖

User avatar: github  User avatar: annegentle  User avatar: tonjohn  User avatar: Zhenglei-BCS  User avatar:   

User avatar: Chooksta69  User avatar: MattWillFlood  User avatar: jonathan-milan-pollock  User avatar: raoulvdberge  User avatar: robjtede  User avatar: hadley  User avatar: kevinchalet  User avatar: Yousazoe  User avatar: planetoftheweb  User avatar: melton1968  User avatar: szepeviktor  User avatar: sckott  User avatar: provinzkraut  User avatar: electrovir  User avatar: Griefed  User avatar: MontezumaIves  User avatar: wylie  User avatar: pylapp  User avatar:   User avatar:   

Getting Started✈️

You can include the action in your workflow to trigger on any event thatGitHub Actions supports.

Important

You'll need to provide the action with aPersonal Access Token (PAT) scoped toread:user andread:org.

Additionally, this action only applies the template within the workspace. You will need to combine it with a deployment action in order to commit it to your project. You can see a full example of this below.

name:Generate Sponsors READMEon:workflow_dispatch:schedule:    -cron:30 15 * * 0-6permissions:contents:writejobs:deploy:runs-on:ubuntu-lateststeps:      -name:Checkout 🛎️uses:actions/checkout@v2      -name:Generate Sponsors 💖uses:JamesIves/github-sponsors-readme-action@v1with:token:${{ secrets.PAT }}file:'README.md'# ⚠️ Note: You can use any deployment step here to automatically push the README# changes back to your branch.      -name:Deploy to GitHub Pages 🚀uses:JamesIves/github-pages-deploy-action@v4with:branch:mainfolder:'.'

You'll also need to add the following<!-- sponsors --><!-- sponsors --> in your.md file so the action knows where to place the data.

#Awesome ProjectGo you!##SponsorsThese are our really cool sponsors!<!-- sponsors--><!-- sponsors-->

Install as a Node Module 📦

If you'd like to use the functionality provided by this action in your own action you can eithercreate a composite action, or you can install it usingyarn ornpm by running the following commands. It's available on both thenpm andGitHub registry.

yarn add @jamesives/github-sponsors-readme-action
npm install @jamesives/github-sponsors-readme-action

It can then be imported into your project like so.

importrunfrom'@jamesives/github-sponsors-readme-action'run({token:process.env.GITHUB_TOKEN})

Calling the functions directly will require you to pass in an object containing the variables found in theconfiguration section.

Configuration 📁

Thewith portion of the workflowmust be configured before the action will work. You can add these in thewith section found in the examples above. Anysecrets must be referenced using the bracket syntax and stored in the GitHub repository'sSettings/Secrets menu. You can learn more about setting environment variables with GitHub actionshere.

Required Setup

The following options must be configured.

KeyValue InformationTypeRequired
tokenYou must provide the action with a Personal Access Token (PAT) with theread:user andread:org permission scope and store it in thesecrets / with menuas a secret. This should be generated from the account or organization that receives sponsorship, and depending on your use case you may need to provide additional scopes.Learn more about creating and using encrypted secrets here.withYes
fileThis should point to the file that you're generating, for exampleREADME.md orpath/to/CREDITS.md. Defaults toREADME.md if no value is provided.withYes

Optional Choices

KeyValue InformationTypeRequired
organizationIf you're displaying sponsorship information as or for an organization you should toggle this option totrue. You also need to provide the action with anread:org andread:user scoped PAT.Note: The PAT must belong to an owner of the organization.withNo
minimumUsing this input you can set the minimum sponsorship threshold. For example setting this to500 will only display sponsors who give of$5 USD and more. By default the action will display all of your sponsors.withNo
maximumUsing this input you can set the maximum sponsorship threshold. For example setting this to500 will only display sponsors who give of$5 USD and less. By default the action will display all of your sponsors.withNo
markerThis allows you to modify the marker comment that is placed in your file. By default this is set to sponsors -<!-- sponsors --> <!-- sponsors -->, if you set this togold for example you can place<!-- gold --> <!-- gold --> in your file.withNo
fallbackAllows you to specify a fallback if you have no sponsors. By default nothing is displayed.withNo
templateAllows you to modify the default template. Please refer to thetemplate section of this README for more information.withNo
active-onlyIf set tofalse, inactive sponsors will be displayed. This can be useful if you want to display all sponsors, regardless of their status. By default this is set totrue.withNo
include-privateIf set totrue, private sponsors will be displayed in the list, however any identifying information will be redacted. This can be useful if you want to display all sponsors, regardless of their privacy settings.withNo

Deployment Status

The action will export a step output assponsorship-status that you can use in your workflow to determine if the task was successful or not. You can find an explanation of each status type below.

StatusDescription
successThesuccess status indicates that the action was able to successfully generate the README.
failedThefailed status indicates that the action encountered an error while trying to generate the README.
skippedTheskipped status indicates that the action could not locate the markers in your .md file.
runningTherunning status indicates that the action is actively working.

Modifying the Template 🔧

You can modify the template that gets generated in your file by using thetemplate input. This input allows you to leverage mustache templating to modify what is displayed. The following values are available.

StatusDescription
nameThe users full name. This can sometimes benull if the user hasn't set one. This can be accessed using{{ name }}
loginThe users login, this can be accessed using{{ login }}
urlThe users GitHub profile url, this can be accessed using{{ url }}.
avatarUrlThe users avatar url, this can be accessed using{{ avatarUrl }}.
websiteUrlThe users website url. This can sometimes benull if the user hasn't set one, if so this field will fall back tourl. This can be accessed using{{ websiteUrl }}.

You're able to use markdown or GitHub approved basic HTML. The default template can be foundhere.

You can view a full example of this here.

name:Generate Sponsors READMEon:push:branches:      -mainpermissions:contents:writejobs:deploy:runs-on:ubuntu-lateststeps:      -name:Checkout 🛎️uses:actions/checkout@v2      -name:Generate Sponsors 💖uses:JamesIves/github-sponsors-readme-action@v1with:token:${{ secrets.PAT }}file:'README.md'template:'* [{{ name }}]({{ url }}) - {{ login }}'      -name:Deploy to GitHub Pages 🚀uses:JamesIves/github-pages-deploy-action@v4with:branch:mainfolder:'.'
#Awesome ProjectGo you!##SponsorsThese are our really cool sponsors!<!-- sponsors--><!-- sponsors-->


Separating by Sponsorship Tier ✨

If you'd like to highlight certain users who contribute to a specific sponsorship tier you can do so using a combination of theminimum,maximum andmarker inputs. Theminimum / maximum inputs equal their dollar contribution in cents.

You can view a full example of this here.

name:Generate Sponsors READMEon:push:branches:      -mainpermissions:contents:writejobs:deploy:runs-on:ubuntu-lateststeps:      -name:Checkout 🛎️uses:actions/checkout@v2      -name:Generate Sponsors 💖uses:JamesIves/github-sponsors-readme-action@v1with:token:${{ secrets.PAT }}file:'README.md'minimum:500maximum:999marker:'silver'      -name:Generate Sponsors 💖uses:JamesIves/github-sponsors-readme-action@v1with:token:${{ secrets.PAT }}file:'README.md'minimum:1000marker:'gold'      -name:Deploy to GitHub Pages 🚀uses:JamesIves/github-pages-deploy-action@v4with:branch:mainfolder:'.'
#Awesome ProjectGo you!##Gold Sponsors<!-- gold--><!-- gold-->##Silver Sponsors<!-- silver--><!-- silver-->

About

❤️ This GitHub Action will automatically add your GitHub Sponsors to your README. It can be configured in multiple ways allowing you to display and breakdown your sponsors by price tier with fallbacks.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors8


[8]ページ先頭

©2009-2025 Movatter.jp