feat(CI): auto-update README.md

This commit is contained in:
Stephan Seitz
2020-08-30 14:29:10 +02:00
committed by Thomas Vigouroux
parent ac13baadb6
commit ffe7d96dfd
3 changed files with 17 additions and 10 deletions

View File

@@ -1,11 +1,12 @@
name: Check README parser info
on: [push, pull_request]
on: push
jobs:
luacheck:
update-readme:
name: Check README parser info
runs-on: ubuntu-latest
if: github.ref != 'master'
steps:
- uses: actions/checkout@v1
@@ -18,8 +19,17 @@ jobs:
mkdir -p ~/.local/share/nvim/site/pack/nvim-treesitter/start
ln -s $(pwd) ~/.local/share/nvim/site/pack/nvim-treesitter/start
- name: Compile parsers
run: ./nvim.appimage --headless -c "TSInstallSync all" -c "q"
# inspired by nvim-lspconfigs
- name: Check README
run: ./nvim.appimage --headless -c "luafile ./scripts/update-readme.lua" -c "q"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_MSG: |
[docgen] Update README.md
skip-checks: true
run: |
git config user.email "actions@github"
git config user.name "Github Actions"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
./nvim.appimage --headless -c "luafile ./scripts/update-readme.lua" -c "q" || git add README.md
# Only commit and push if we have changes
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin HEAD:${GITHUB_REF})