-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (35 loc) · 1.09 KB
/
contributions.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
name: Do 2000+ GH contributions/year
on:
push:
branches: [ master ]
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: sudo apt-get install jq curl -y
- name: Get total contributions
uses: octokit/graphql-action@v2.x
id: get_contributions
with:
query: |
query($owner: String!) {
user(login: $owner) {
contributionsCollection {
contributionCalendar {
totalContributions
}
}
}
}
owner: "hakatashi"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Test if contibution requirement is satisfied
run: >-
echo "Current total contributions per year: ${{ env.CONTRIBUTIONS }}" &&
test ${{ env.CONTRIBUTIONS }} -ge 2000
env:
CONTRIBUTIONS: ${{ fromJSON(steps.get_contributions.outputs.data).user.contributionsCollection.contributionCalendar.totalContributions }}