Update tree-sitter parsers JSON #101
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 tree-sitter parsers JSON | |
# Prevent concurrent auto-commits | |
concurrency: | |
group: update-tree-sitter-parsers-json | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- 'scripts/echo-ts-json.lua' | |
- .github/workflows/update-ts-parsers-json.yml | |
schedule: | |
# Runs every 7 hours | |
- cron: "0 */7 * * *" | |
workflow_dispatch: | |
jobs: | |
update-tree-sitter-parsers-json: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.ref }} | |
- uses: actions/checkout@v4 | |
with: | |
repository: nvim-treesitter/nvim-treesitter | |
path: nvim-treesitter | |
ref: main | |
- uses: rhysd/action-setup-vim@v1 | |
with: | |
neovim: true | |
version: nightly | |
- name: Update tree-sitter parsers JSON | |
run: | | |
./scripts/echo-ts-json.lua \ | |
| jq '{parsers: [to_entries[] | {lang: .key} + (.value | del(.maintainers))]}' \ | |
> tree-sitter-parsers.json | |
- name: Get nvim-treesitter commit SHA | |
run: | | |
cp nvim-treesitter/.git/refs/heads/main resources/nvim-treesitter.lock | |
- name: commit | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "chore: update tree-sitter-parsers.json" | |
file_pattern: "tree-sitter-parsers.json resources/nvim-treesitter.lock" |