-
Notifications
You must be signed in to change notification settings - Fork 3
51 lines (43 loc) · 1.39 KB
/
update-readme.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
name: Update README
on:
push:
branches:
- main
paths:
- "icons/**"
workflow_dispatch:
jobs:
update-readme:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- name: Cooldown
run: sleep 60
- uses: actions/checkout@v4
- name: Generating
run: |
ICONS_TABLE=$(curl -s "https://skills-icons.vercel.app/api/readme")
awk -v table="$ICONS_TABLE" '
/### Available Icons 🎨/,/### Contributing 🎖️/ {
if ($0 ~ /### Available Icons 🎨/) {
print $0
print ""
print "Below is a complete list of available icons and their IDs. You can use either the full ID or its alias (if available) in the `i` parameter."
print ""
print table
print ""
}
if ($0 ~ /### Contributing 🎖️/) {
print $0
}
next
}
{ print }
' README.md > README.new
mv README.new README.md
- name: Commit and push if changed
run: |
git config --global user.name "GitHub Action"
git config --global user.email "[email protected]"
git add README.md
git diff --quiet && git diff --staged --quiet || (git commit -m "chore: update readme" && git push)