-
-
Notifications
You must be signed in to change notification settings - Fork 5
64 lines (58 loc) · 2.28 KB
/
badges.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
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:
# Runs on pushes targeting the default branch
push:
branches: ["dev", "dev-update"]
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
jobs:
Badges:
name: Badges
runs-on: ubuntu-22.04 # ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
env:
fetch-depth: "1"
with:
path: repository
- name: Get Badge Data
run: |
SNIPPETS_TOTAL=$(find repository/snippets/ -type f | wc -l)
SNIPPETS_FUNCTIONS=$(find repository/snippets/Functions -type f | wc -l)
SNIPPETS_OBJECTMANAGER=$(find repository/snippets/ObjectManager -type f | wc -l)
SNIPPETS_MODULES=$(find repository/snippets/Modules -type f | wc -l)
SNIPPETS_GENERATED=$((SNIPPETS_FUNCTIONS + SNIPPETS_OBJECTMANAGER + SNIPPETS_MODULES))
SNIPPETS_STATIC=$((SNIPPETS_TOTAL - SNIPPETS_GENERATED))
{
echo "SNIPPETS_TOTAL=$SNIPPETS_TOTAL"
echo "SNIPPETS_GENERATED=$SNIPPETS_GENERATED"
echo "SNIPPETS_STATIC=$SNIPPETS_STATIC"
} >> "$GITHUB_ENV"
- name: Create Total Snippet Counter Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST }}
gistID: e2729bfd9b81d9c032ded617a3f924e7
filename: ${{ github.event.repository.name }}:snippets-total.json
label: Snippets Total
message: ${{ env.SNIPPETS_TOTAL }}
color: blue
- name: Create Generated Snippet Counter Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST }}
gistID: e2729bfd9b81d9c032ded617a3f924e7
filename: ${{ github.event.repository.name }}:snippets-generated.json
label: Snippets Generated
message: ${{ env.SNIPPETS_GENERATED }}
color: blue
- name: Create Static Snippet Counter Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST }}
gistID: e2729bfd9b81d9c032ded617a3f924e7
filename: ${{ github.event.repository.name }}:snippets-static.json
label: Snippets Static
message: ${{ env.SNIPPETS_STATIC }}
color: blue