File tree 4 files changed +7
-1
lines changed
4 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 22
22
GitHub classis access token with admin:org & user scopes ($GH_CLASSIC_ACCESS_TOKEN).
23
23
--entities=ENTITIES,... The GitHub entities to process sponsorships for. First entity in the list is
24
24
considered DEFAULT.
25
+ --sponsor-amount=1 The amount to donate to each dependency
25
26
--wkr-td-disabled Disable worker.
26
27
--wkr-animate-disabled Disable worker.
27
28
--wkr-donate-disabled Disable worker.
Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ var cli struct {
44
44
45
45
Entities []wkrghsponsor.Entity `help:"The GitHub entities to process sponsorships for. First entity in the list is considered DEFAULT." required:""`
46
46
47
+ SponsorAmount wkrghsponsor.SponsorAmount `help:"The amount to donate to each dependency" default:"1"`
48
+
47
49
WkrTd wkr_config `embed:"" prefix:"wkr-td-"`
48
50
WkrAnimate wkr_config `embed:"" prefix:"wkr-animate-"`
49
51
WkrDonate wkr_config `embed:"" prefix:"wkr-donate-"`
@@ -106,6 +108,7 @@ func main() {
106
108
kctx .Bind (cli .TdApiKey )
107
109
kctx .Bind (cli .GhClassicAccessToken )
108
110
kctx .Bind (cli .Entities )
111
+ kctx .Bind (cli .SponsorAmount )
109
112
110
113
// Start the workers
111
114
wkrs := []struct {
Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ type TdApiUrl string
4
4
type TdApiKey string
5
5
type GhAccessToken string
6
6
type Entity string
7
+ type SponsorAmount int
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import (
26
26
func New (
27
27
db * database.DB ,
28
28
ghAccesstoken wkrghsponsor.GhAccessToken ,
29
+ sponsorAmount wkrghsponsor.SponsorAmount ,
29
30
) workers.Worker {
30
31
return func (ctx context.Context ) error {
31
32
logger := log .FromContext (ctx )
@@ -57,7 +58,7 @@ func New(
57
58
return err
58
59
}
59
60
60
- amount := githubv4 .Int (1 )
61
+ amount := githubv4 .Int (sponsorAmount )
61
62
isRecurring := githubv4 .Boolean (false )
62
63
privacyLevel := githubv4 .SponsorshipPrivacy (githubv4 .SponsorshipPrivacyPublic )
63
64
You can’t perform that action at this time.
0 commit comments