• Stars
    star
    221
  • Rank 179,773 (Top 4 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

💖🔖 A GitHub Action that labels issues/PRs if the author sponsors the owner of the repo

💖

is-sponsor-label-action

A GitHub Action that labels issues/PRs if the creator is a sponsor of the owner

GitHub Actions status Codecov

Examples

Imagine Alice sponsors Bob through GitHub Sponsors, and Bob owns a public repo, which includes this sponsor-label action. Then, when Alice opens an issue or PR on that repo, a bot will automatically add a sponsor 💖 label.

Screenshot of an issue created by a sponsor, with the sponsor label added

You can see the above example here: devonzuegel/highly-exporter#4

Usage

You can create a .github/workflows/label-sponsors.yml file:

name: Label sponsors
on:
  pull_request:
    types: [opened]
  issues:
    types: [opened]
jobs:
  build:
    name: is-sponsor-label
    runs-on: ubuntu-latest
    steps:
      - uses: JasonEtco/is-sponsor-label-action@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

This will trigger the action when an issue or pull request is opened. You'll need to include the GITHUB_TOKEN environment variable!

By default, the label sponsor will be applied. If you have a different label you want to use, you can set that:

      - uses: JasonEtco/is-sponsor-label-action@v1
        with:
          label: Sponsor Request ❤️
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

How it works

This action is designed to be triggered by the issues or pull_request events, specifically the opened action. When an issue or PR is opened, the action will make the following query:

query ($owner: String!) { 
  user (login: $owner) {
    sponsorshipsAsMaintainer (first: 100) {
      nodes {
        sponsor {
          id
        }
      }
    }
  }
}

It will then check to see if the creator of the issue/PR is one of the sponsors in the list. If not, it'll try the next page of sponsors until it runs out.

Note! This query checks to see if the opener is a sponsor of the repository's owning user. This does not cover all cases of sponsorship!

If the opener is a sponsor, the action will then add the sponsor label to the issue or pull request.

More Repositories

1

actions-toolkit

🛠 A toolkit for building GitHub Actions in Node.js
TypeScript
928
star
2

todo

🤖✅ GitHub App that creates new issues from actionable comments in your code.
JavaScript
741
star
3

create-an-issue

A GitHub Action for creating a new issue from a template file.
TypeScript
268
star
4

rss-to-readme

📡📝 A GitHub Action that updates a section of a README from an RSS feed.
TypeScript
221
star
5

activity-box

⚡️📌 Update a pinned gist to contain the latest activity of a user
JavaScript
212
star
6

upload-to-release

A GitHub Action that uploads a file to a new release.
Shell
177
star
7

build-and-tag-action

📦🔖 A GitHub Action for publishing JavaScript Actions
TypeScript
94
star
8

gist-box

📌📋 A helper class for updating a single-file Gist
TypeScript
84
star
9

action-badges

🛡⚡️ A README badge service for GitHub Actions
JavaScript
61
star
10

ci-reporter

🚧📝 GitHub App to show CI failure logs in PR comments
JavaScript
48
star
11

flintcms

🔥💥 A Node.js CMS
JavaScript
45
star
12

readme-box

📝⚙️ Lil' helper for replacing a section of the contents of a README.
TypeScript
31
star
13

npm-audit-fix-action

[WIP] GitHub Action that opens a pull request following an npm audit fix
JavaScript
29
star
14

jasonet.co

📝 My personal site and blog
Nunjucks
27
star
15

readme-guestbook

A little web app that transforms a README into a guestbook.
HTML
21
star
16

good-first-pin

🤖📌 A GitHub App built with Probot that rotates pinned issues based on Good First Issue labels
TypeScript
16
star
17

octokit-create-new-file

Creates a new file on a new branch and opens a new pull request.
JavaScript
15
star
18

action-record

📑 An "ORM" for storing data to a GitHub repository using GitHub Actions
TypeScript
13
star
19

smee-action

🔴📜 Use smee.io to debug GitHub Action runs
JavaScript
13
star
20

JasonEtco

11
star
21

slash-assign-action

A GitHub Action that listens for a `/assign` "command" and assigns the commenter to the issue.
TypeScript
10
star
22

github-user-status

A CLI for setting your GitHub user status
TypeScript
9
star
23

progressvg

💯% Progress bar as a service
JavaScript
6
star
24

push-to-gh-pages

📦💻 A GitHub Action that pushes a directory to the gh-pages branch
Shell
6
star
25

test-selector

🎭👈 Prompts the user to run specific test suites in a project.
JavaScript
6
star
26

validate-semver-release

🔖🤔 GitHub Action that validates GitHub Releases against semantic versioning
JavaScript
6
star
27

emojify-everything

🍆🔥💯 There aren't enough emojis in your websites. This extension fixes that.
JavaScript
6
star
28

signoff-commit-action

✍️ Action that creates an empty commit with a list of commits to "sign off on"
6
star
29

craft-emailwhitelist

🔒✉ A whitelist of emails for Craft
PHP
5
star
30

dotfiles

💻 Public repo for my personal dotfiles.
Shell
3
star
31

actions-counter

JavaScript
3
star
32

flintcms-site

📙 Landing page & Docs for FlintCMS
CSS
2
star
33

nunjucks-octicons-extension

A Nunjucks extension for using Octicons
JavaScript
2
star
34

jolt

CSS
2
star
35

text-to-emoji

JavaScript
2
star
36

streamydoo

Easy to use stream request handler for your browser
JavaScript
1
star
37

hover

Example of WebSockets using hover behaviors
JavaScript
1
star
38

find-code

🔍💻 Find code snippets in your project
JavaScript
1
star
39

business-card

JavaScript
1
star
40

notarikon4d

JavaScript
1
star
41

tote

[WIP] 👜 tote, a markdown note-taking PWA
JavaScript
1
star
42

khaliun-batmunkh

JavaScript
1
star
43

url-shortener

🔗 URL Shortener, built on a 🚆
JavaScript
1
star
44

grunt-jekyll-post

Prompts questions in command line, then creates a Jekyll post template with the answers.
JavaScript
1
star
45

talks

A repo to store my conference talk slide decks
1
star
46

nunjucks-pre-lexer

🤓 A tool for identifying and fetching the data that a Nunjucks template expects
TypeScript
1
star
47

notarikon

Notarikon means deriving a word from the first letter of each word in a sentence (using an anagram)
JavaScript
1
star
48

smee-client-rb

[WIP]: A programmatic client for Smee, in Ruby.
Ruby
1
star
49

dinner

🦃 Cyberspace Thanksgiving Dinner, with all the people you'd expect.
JavaScript
1
star
50

nunjucks-await-filter

Brings async/await functions to your Nunjucks templates.
JavaScript
1
star
51

server-smee-action

An Action for Servers with Smee
TypeScript
1
star
52

a-learning-lab-course-template

The template repository for the a-learning-lab-course course on Learning Lab.
1
star
53

ondesign-xyz

JavaScript
1
star
54

revolution

JavaScript
1
star
55

personal-site

🌈👌😁 My personal website and portfolio
JavaScript
1
star
56

discord-namer

🎮 Changes my Discord nickname when I'm @-mentioned, using a random emoji.
JavaScript
1
star
57

github-bulk-transfer

Simple CLI utility to trigger bulk transfers of github repos through a headless browser
JavaScript
1
star