File tree Expand file tree Collapse file tree 3 files changed +27
-32
lines changed Expand file tree Collapse file tree 3 files changed +27
-32
lines changed Original file line number Diff line number Diff line change 33
33
env :
34
34
GH_TOKEN : ${{ secrets.SPONSORS_TOKEN }}
35
35
GH_LOGIN : your-org
36
- run : |
37
- QUERY='query($login:String!){
38
- organization(login:$login){
39
- monthlyEstimatedSponsorsIncomeInCents
40
- sponsorshipsAsMaintainer(first:1){ totalCount }
41
- }
42
- }'
43
- RESP=$(curl -s https://api.github.com/graphql \
44
- -H "Authorization: Bearer $GH_TOKEN" \
45
- -H "Content-Type: application/json" \
46
- -d "{\"query\":\"$QUERY\",\"variables\":{\"login\":\"$GH_LOGIN\"}}")
47
- CENTS=$(echo "$RESP" | jq '.data.organization.monthlyEstimatedSponsorsIncomeInCents // 0')
48
- COUNT=$(echo "$RESP" | jq '.data.organization.sponsorshipsAsMaintainer.totalCount // 0')
49
- jq -n --argjson sum "$CENTS" --argjson count "$COUNT" \
50
- '{ sponsor_sum: ($sum/100|floor), sponsor_count: $count }' \
51
- > website/_data/gh_sponsors.json
36
+ uses : ./FetchGHSponsors
52
37
53
38
- name : Setup .NET Core SDK
54
39
uses : actions/setup-dotnet@v4
Original file line number Diff line number Diff line change 30
30
env :
31
31
GH_TOKEN : ${{ secrets.SPONSORS_TOKEN }}
32
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
33
+ uses : ./FetchGHSponsors
49
34
50
35
- name : Setup .NET Core SDK
51
36
uses : actions/setup-dotnet@v4
Original file line number Diff line number Diff line change
1
+ name : Fetch GH Sponsors
2
+ description : ' Updates the GitHub spondors list for the Monogame website'
3
+ author : ' MonoGame Foundation'
4
+ runs :
5
+ using : " composite"
6
+ steps :
7
+ - name : Fetch
8
+ if : runner.os == 'Linux'
9
+ run : |
10
+ QUERY='query($login:String!){
11
+ organization(login:$login){
12
+ monthlyEstimatedSponsorsIncomeInCents
13
+ sponsorshipsAsMaintainer(first:1){ totalCount }
14
+ }
15
+ }'
16
+ RESP=$(curl -s https://api.github.com/graphql \
17
+ -H "Authorization: Bearer $GH_TOKEN" \
18
+ -H "Content-Type: application/json" \
19
+ -d "{\"query\":\"$QUERY\",\"variables\":{\"login\":\"$GH_LOGIN\"}}")
20
+ CENTS=$(echo "$RESP" | jq '.data.organization.monthlyEstimatedSponsorsIncomeInCents // 0')
21
+ COUNT=$(echo "$RESP" | jq '.data.organization.sponsorshipsAsMaintainer.totalCount // 0')
22
+ jq -n --argjson sum "$CENTS" --argjson count "$COUNT" \
23
+ '{ sponsor_sum: ($sum/100|floor), sponsor_count: $count }' \
24
+ > website/_data/gh_sponsors.json
25
+ shell : bash
You can’t perform that action at this time.
0 commit comments