Update README #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update README | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "icons/**" | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
update-readme: | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Wait for 2 minutes | |
run: sleep 120 | |
- uses: actions/checkout@v4 | |
- name: Update README | |
run: | | |
ICONS_TABLE=$(curl -s "https://skills-icons.vercel.app/api/icons/table") | |
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 icons table" && git push) |