Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c257e9a

Browse files
committed
chore: track upstream main branch for vendor submodules
- Add branch = main to each submodule in .gitmodules - Add GitHub Actions workflow that checks every 6 hours for upstream updates and opens a PR automatically Co-Authored-By: claude-flow <[email protected]>
1 parent 6e76578 commit c257e9a

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Update vendor submodules
2+
3+
on:
4+
schedule:
5+
- cron: '0 */6 * * *' # Every 6 hours
6+
workflow_dispatch: # Manual trigger
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
update:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
submodules: true
19+
fetch-depth: 0
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Update submodules to latest main
23+
run: git submodule update --remote --merge
24+
25+
- name: Check for changes
26+
id: check
27+
run: |
28+
if git diff --quiet; then
29+
echo "changed=false" >> "$GITHUB_OUTPUT"
30+
else
31+
echo "changed=true" >> "$GITHUB_OUTPUT"
32+
fi
33+
34+
- name: Create PR with updates
35+
if: steps.check.outputs.changed == 'true'
36+
run: |
37+
git config user.name "github-actions[bot]"
38+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
39+
BRANCH="chore/update-submodules-$(date +%Y%m%d-%H%M%S)"
40+
git checkout -b "$BRANCH"
41+
git add vendor/
42+
git commit -m "chore: update vendor submodules to latest main"
43+
git push origin "$BRANCH"
44+
gh pr create \
45+
--title "chore: update vendor submodules" \
46+
--body "Automated submodule update to latest upstream main." \
47+
--base main \
48+
--head "$BRANCH"
49+
env:
50+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
[submodule "vendor/midstream"]
22
path = vendor/midstream
33
url = https://github.com/ruvnet/midstream
4+
branch = main
45
[submodule "vendor/ruvector"]
56
path = vendor/ruvector
67
url = https://github.com/ruvnet/ruvector
8+
branch = main
79
[submodule "vendor/sublinear-time-solver"]
810
path = vendor/sublinear-time-solver
911
url = https://github.com/ruvnet/sublinear-time-solver
12+
branch = main

0 commit comments

Comments
 (0)