File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 26
26
- name : Clone Repository
27
27
uses : actions/checkout@v4
28
28
29
+ - name : Fetch GH Sponsors
30
+ env :
31
+ GH_TOKEN : ${{ secrets.SPONSORS_TOKEN }}
32
+ GH_LOGIN : your-org
33
+ run : |
34
+ QUERY='query($login:String!){
35
+ organization(login:$login){
36
+ monthlyEstimatedSponsorsIncomeInCents
37
+ sponsorshipsAsMaintainer(first:1){ totalCount }
38
+ }
39
+ }'
40
+ RESP=$(curl -s https://api.github.com/graphql \
41
+ -H "Authorization: Bearer $GH_TOKEN" \
42
+ -H "Content-Type: application/json" \
43
+ -d "{\"query\":\"$QUERY\",\"variables\":{\"login\":\"$GH_LOGIN\"}}")
44
+ CENTS=$(echo "$RESP" | jq '.data.organization.monthlyEstimatedSponsorsIncomeInCents // 0')
45
+ COUNT=$(echo "$RESP" | jq '.data.organization.sponsorshipsAsMaintainer.totalCount // 0')
46
+ jq -n --argjson sum "$CENTS" --argjson count "$COUNT" \
47
+ '{ sponsor_sum: ($sum/100|floor), sponsor_count: $count }' \
48
+ > website/_data/gh_sponsors.json
49
+
29
50
- name : Setup .NET Core SDK
30
51
uses : actions/setup-dotnet@v4
31
52
with :
You can’t perform that action at this time.
0 commit comments