-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (64 loc) · 1.97 KB
/
badges.yaml
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
name: Badges
on:
push:
branches:
- main
jobs:
git-estimate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '1.22.1'
cache: false
- name: Estimate time spent
run: |
git clone https://github.com/luigitni/git-estimate.git /tmp/git-estimate
cd /tmp/git-estimate
go build git-estimate
go install
cd -
sudo apt install jq jo
HOURS=$(git-estimate -json | jq '.overall.hours | round')
jo -p \
"schemaVersion=1" \
"label=⏳ Time spent" \
"message=$HOURS hours" \
"color=blue" \
"style=for-the-badge" > fish-ai-badge-git-estimate.json
- name: Store result
uses: realiserad/actions-deploy-gist@main
with:
token: ${{ secrets.TOKEN }}
gist_id: e6c5166b6c0e77febe5cbd719c6c236a
file_path: fish-ai-badge-git-estimate.json
unique-cloners:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
sudo apt install jq jo
gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/Realiserad/fish-ai/traffic/clones > clones.json
UNIQUE_CLONERS=$(jq '.uniques' clones.json)
jo -p \
"schemaVersion=1" \
"label=🍾 Popularity" \
"message=$UNIQUE_CLONERS users" \
"color=blue" \
"style=for-the-badge" > fish-ai-badge-unique-cloners.json
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Store result
uses: exuanbo/actions-deploy-gist@v1
with:
token: ${{ secrets.TOKEN }}
gist_id: e6c5166b6c0e77febe5cbd719c6c236a
file_path: fish-ai-badge-unique-cloners.json