name: Update Parser Dependencies

on:
  schedule:
    - cron: "0 0 * * 0" # every week

  workflow_dispatch:

permissions:
  contents: write
  pull-requests: write

env:
  GRAMMAR_NAME: sdml
  NODE_VERSION: 24

jobs:
  update:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v5

      - name: Setup Node
        uses: actions/setup-node@v5
        with:
          cache: npm
          node-version: ${{ env.NODE_VERSION }}

      - name: Parser dependency updates
        uses: tree-sitter/parser-update-action@v1.1
        with:
          language-name: ${{ env.GRAMMAR_NAME }}
