-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
69 lines (66 loc) · 2.66 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Sponsor Labeler
author: Daniel Cazzulino
description: |
A GitHub Action that labels issues and pull requests if
the creator is a sponsor (directly or indirectly via org or contributions).
inputs:
label:
description: The default sponsor label to apply to the issue or pull request. Defaults to "sponsor 💜".
required: false
default: 'sponsor 💜'
contrib-label:
description: The label to apply to the issue or pull request for past contributors. Defaults to "sponsor 💚".
required: false
default: 'sponsor 💚'
silver-label:
description: The label to apply when sponsor amount is above the silver-amount. Defaults to "sponsor 🤍".
required: false
default: 'sponsor 🤍'
silver-amount:
description: Sponsors over this amount are labeled with silver-label instead. Defaults to 50.
required: false
default: 50
gold-label:
description: The label to apply when sponsor amount is above the gold-amount. Defaults to "sponsor 💛".
required: false
default: 'sponsor 💛'
gold-amount:
description: Sponsors over this amount are labeled with gold-label instead. Defaults to 100.
required: false
default: 100
sponsorable:
description: The account to check for sponsorship. Defaults to the repository owner.
required: false
default: ${{ github.repository_owner }}
token:
description: The token to use for querying the GitHub API for sponsorship information. Typically set to secrets.GH_TOKEN.
required: true
verbose:
description: Whether to perform verbose logging when failing to find a sponsorship. Defaults to false.
required: false
default: false
branding:
icon: heart
color: purple
runs:
using: "composite"
steps:
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
shell: bash
- name: 💜 sponsor
if: ${{ !endsWith(github.event.sender.login, '[bot]') && github.event.sender.login != inputs.sponsorable }}
shell: pwsh
env:
SPONSORABLE: ${{ inputs.sponsorable }}
SPONSOR_LABEL: ${{ inputs.label }}
SPONSOR_CONTRIB_LABEL: ${{ inputs.contrib-label }}
SPONSOR_SILVER_LABEL: ${{ inputs.silver-label }}
SPONSOR_SILVER_AMOUNT: ${{ inputs.silver-amount }}
SPONSOR_GOLD_LABEL: ${{ inputs.gold-label }}
SPONSOR_GOLD_AMOUNT: ${{ inputs.gold-amount }}
SPONSOR_SENDER_LOGIN: ${{ github.event.sender.login }}
SPONSOR_SENDER_ID: ${{ github.event.sender.node_id }}
SPONSOR_ISSUE: ${{ github.event.issue.number || github.event.pull_request.number }}
SPONSOR_VERBOSE: ${{ inputs.verbose }}
GH_TOKEN: ${{ inputs.token }}
run: sponsor-labeler.ps1