Skip to content

Latest commit

 

History

History
172 lines (146 loc) · 12.8 KB

readme.md

File metadata and controls

172 lines (146 loc) · 12.8 KB

💜 sponsor

A GitHub Action that labels issues and pull requests if the creator is a sponsor, or belongs to an organization that is.

Usage

- name: 💜 sponsor
  uses: devlooped/actions-sponsor@v1
  with:
    # The label to apply to the issue or pull request. 
    # Defaults to "sponsor 💜".
    label: ''

    # The label to apply when sponsor amount is above the gold-amount. 
    # Defaults to "sponsor 💛".
    gold-label: ''

    # Sponsors over this amount are labeled with gold-label instead. 
    # Defaults to 100.
    gold-amount: ''

    # The account to check for sponsorship. 
    # Defaults to the repository owner `${{ github.repository.owner }}`
    sponsorable: ''

    # The token to use for querying the GitHub API for sponsorship information. 
    # Typically set to ${{ secrets.GH_TOKEN }}.
    token: ''

NOTE: in order to detect the sponsorship tier to trigger gold sponsor labeling, the token must be an owner of the sponsorable organization. Otherwise, only
base sponsoring is detected.

Example

Minimal example, using default labels, repo owner and gold label threshold:

name: sponsor 💜
on: 
  issues:
    types: [opened, edited, reopened]
  pull_request:
    types: [opened, edited, synchronize, reopened]

jobs:
  sponsor:
    runs-on: ubuntu-latest
    if: ${{ !endsWith(github.event.sender.login, '[bot]') && !endsWith(github.event.sender.login, 'bot') }}      
    steps:
      - name: 🤘 checkout
        uses: actions/checkout@v2
    
      - name: 💜 sponsor 
        uses: devlooped/actions-sponsor@v1
        with:
          token: ${{ secrets.GH_TOKEN }}

NOTE: you will typically want to skip running the workflow at all for bot accounts, hence the if above.

Full example overriding all values (and running on all issue/PR events):

name: sponsor 💜
on: [issues, pull_request]

jobs:
  sponsor:
    runs-on: ubuntu-latest
    if: ${{ !endsWith(github.event.sender.login, '[bot]') && !endsWith(github.event.sender.login, 'bot') }}      
    steps:
      - name: 🤘 checkout
        uses: actions/checkout@v2

      - name: 💜 sponsor 
        uses: devlooped/actions-sponsor@v1
        with:
          label: sponsor
          gold-label: gold sponsor
          gold-amount: 1000
          sponsorable: moq
          token: ${{ secrets.MOQ_TOKEN }}

Note: the provided token must have access to retrieve sponsorships for the sponsorable account.

Sponsors

Clarius Org Kirill Osenkov MFB Technologies, Inc. Stephen Shaw Torutek DRIVE.NET, Inc. David Kean Daniel Gnägi Ashley Medway Keith Pickford bitbonk Thomas Bolon Yurii Rashkovskii Kori Francis Zdenek Havlin Sean Killeen Toni Wenzel Giorgi Dalakishvili Kelly White Allan Ritchie Mike James Uno Platform Dan Siegel Reuben Swartz Jeremy Simmons Jacob Foshee Eric Johnson Norman Mackay Certify The Web Taylor Mansfield Mårten Rånge David Petric Rich Lee Danilo das Neves Dantas Gary Woodfine Steve Bilogan Ix Technologies B.V. New Relic Chris Johnston‮ David JENNI Jonathan Oleg Kyrylchuk Juan Blanco LosManos Mariusz Kogut Charley Wu Thomas Due Jakob Tikjøb Andersen Seann Alexander Tino Hager Badre BSAILA Mark Seemann Angelo Belchior Tony Qu Daniel May Blauhaus Technology (Pty) Ltd Richard Collette Nick Vaughan Ken Bonny Simon Cropp

Sponsor this project  

Learn more about GitHub Sponsors