Copy and Sync Tree-Sitter Files #9
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: Copy and Sync Tree-Sitter Files | |
on: | |
schedule: | |
- cron: "0 0 * * 0" # weekly | |
workflow_dispatch: | |
jobs: | |
sync: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: "recursive" | |
- name: Run copy script | |
run: ./copy.sh | |
- name: Update submodule & Verify no changes | |
run: | | |
git submodule update --remote | |
git diff --exit-code || echo "Changes found" | |
- name: Commit new changes and create PR | |
if: ${{ failure() }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git branch -D auto-sync-tree-sitter || true | |
git push origin --delete auto-sync-tree-sitter || true | |
git checkout -b auto-sync-tree-sitter | |
git add src include tree-sitter | |
git commit -m "chore(auto-sync): update core tree-sitter library" | |
gh pr create --title "chore(auto-sync): update core tree-sitter library" --body "This PR was automatically generated by the GitHub Actions workflow to update the core tree-sitter library." --base master --head auto-sync-tree-sitter |