-
Notifications
You must be signed in to change notification settings - Fork 7
93 lines (81 loc) · 2.82 KB
/
update-points-bar.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Update Points Bar
on:
workflow_dispatch:
jobs:
update:
name: Update points bar
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# switch to svg-build branch
- run: git checkout svg-build || git checkout -b svg-build
# generate random points
- name: random points
id: random-points
run: |
points=$((10 + $RANDOM % 80))"/100"
echo "::set-output name=points::$points"
# create points bar
- name: points bar
uses: markpatterson27/points-bar@v1
with:
points: ${{ steps.random-points.outputs.points }}
path: '.github/icons/points-bar.svg'
# create points badge
- name: points badge
uses: markpatterson27/points-bar@v1
with:
points: ${{ steps.random-points.outputs.points }}
path: '.github/icons/points-badge.svg'
type: 'badge'
# create points bar with custom colors
- name: points bar color
uses: markpatterson27/points-bar@v1
with:
points: ${{ steps.random-points.outputs.points }}
path: '.github/icons/points-bar-color.svg'
bar-color: 'gold'
bar-background: '#115544'
font-color: '#BF5700'
# create points bar with custom label
- name: score bar
uses: markpatterson27/points-bar@v1
with:
points: ${{ steps.random-points.outputs.points }}
path: '.github/icons/points-bar-custom-label.svg'
label: 'Score'
# create points badge with custom label
- name: autograde badge
uses: markpatterson27/points-bar@v1
with:
points: ${{ steps.random-points.outputs.points }}
path: '.github/icons/points-badge-custom-label.svg'
type: 'badge'
label: 'Autograde'
# create wide points bar
- name: wide points bar
uses: markpatterson27/points-bar@v1
with:
points: ${{ steps.random-points.outputs.points }}
path: '.github/icons/points-bar-wide.svg'
width: 220
# create points badge reversed
- name: points badge reversed
uses: markpatterson27/points-bar@v1
with:
points: ${{ steps.random-points.outputs.points }}
path: '.github/icons/points-badge-reversed.svg'
type: 'badge'
bar-color: '#11BBCC'
bar-background: '#88BBCC'
reverse: true
# commit and push activity icons if svg-builds have changed
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add '.github/icons/points-*.svg'
git commit -m "Add/Update points bar" || exit 0
git push origin svg-build