Pointed GH workflow to ppm #2
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: [master] | |
permissions: write-all | |
jobs: | |
reorganize: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Generate table with `ppm` | |
run: | | |
wget https://github.com/pragtical/plugin-manager/releases/download/latest/ppm.x86_64-linux -O ppm && chmod +x ppm | |
# Unstub all stubs so we can make proper previews. | |
./ppm --userdir . init . && ./ppm --userdir . color install "*" && ./ppm purge --userdir . | |
./ppm exec scripts/make_preview_image.lua colors/* | |
# Remove everything after the --- so we can regenerate it. | |
perl -pi -e 'exit(0) if $_ =~ m/^\-\-\-/' README.md | |
echo "---" >> README.md | |
echo -e "\n## Dark\n" >> README.md | |
./ppm list --repository . --type color --tag "dark" --table 'url,{string.format("![%s_preview](previews/%s.svg)", addon.id,addon.id)}' --type color --header Theme,Preview >> README.md | |
echo -e "\n## Light\n" >> README.md | |
./ppm list --repository . --type color --tag "light" --table 'url,{string.format("![%s_preview](previews/%s.svg)", addon.id,addon.id)}' --type color --header Theme,Preview >> README.md | |
if ! git diff --exit-code -s README.md; then | |
git config --global user.name "Github Actions" && git config --global user.email "<>" | |
git add README.md previews | |
git commit -m '[CI] Updated README.md.' | |
git push | |
fi |