-
Notifications
You must be signed in to change notification settings - Fork 10
38 lines (32 loc) · 1.27 KB
/
copy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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