Update Tree Sitter Parser Info File #14
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
# Inspired by bash-language-server under MIT license | |
# Reference: https://github.com/bash-lsp/bash-language-server/blob/8c42218c77a9451b308839f9a754abde901323d5/.github/workflows/upgrade-tree-sitter.yml | |
name: Update Tree Sitter Parser Info File | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 12 * * 2' | |
jobs: | |
update-tree-sitter-parser-info-file: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
tree-sitter-name: ['tree-sitter-bitbake', 'tree-sitter-bash'] | |
defaults: | |
run: | |
shell: bash | |
env: | |
DBUS_SESSION_BUS_ADDRESS: unix:path=/run/user/1001/bus | |
SHELL: /usr/bin/bash | |
BASE_BRANCH: staging | |
node-version: 20 | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ env.BASE_BRANCH }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
cache: 'npm' | |
cache-dependency-path: | | |
package-lock.json | |
server/package-lock.json | |
client/package-lock.json | |
- name: Install Dependencies | |
run: npm install | |
- name: Update tree-sitter parser info file | |
run: bash scripts/update-${{ matrix.tree-sitter-name }}.sh | |
- name: Verify file changes | |
uses: tj-actions/verify-changed-files@v20 | |
id: verify-changed-files | |
with: | |
files: | | |
server/${{ matrix.tree-sitter-name }}.info | |
- name: Create pull request | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | |
uses: peter-evans/create-pull-request@v6 | |
with: | |
add-paths: | | |
server/${{ matrix.tree-sitter-name }}.info | |
title: Auto update ${{ matrix.tree-sitter-name }} parser info file | |
commit-message: Auto update ${{ matrix.tree-sitter-name }} parser info | |
branch: update-${{ matrix.tree-sitter-name }}-parser-info-file | |
base: ${{ env.BASE_BRANCH }} | |
token: ${{ secrets.GITHUB_TOKEN }} |