add snyk & newrelic icons (#49) #33
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/**" | |
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) |