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 <ruv@ruv.net>
This commit is contained in:
ruv 2026-03-04 13:30:48 -05:00
parent 6e76578dcf
commit c257e9a215
2 changed files with 53 additions and 0 deletions

50
.github/workflows/update-submodules.yml vendored Normal file
View file

@ -0,0 +1,50 @@
name: Update vendor submodules
on:
schedule:
- cron: '0 */6 * * *' # Every 6 hours
workflow_dispatch: # Manual trigger
permissions:
contents: write
pull-requests: write
jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update submodules to latest main
run: git submodule update --remote --merge
- name: Check for changes
id: check
run: |
if git diff --quiet; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Create PR with updates
if: steps.check.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
BRANCH="chore/update-submodules-$(date +%Y%m%d-%H%M%S)"
git checkout -b "$BRANCH"
git add vendor/
git commit -m "chore: update vendor submodules to latest main"
git push origin "$BRANCH"
gh pr create \
--title "chore: update vendor submodules" \
--body "Automated submodule update to latest upstream main." \
--base main \
--head "$BRANCH"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

3
.gitmodules vendored
View file

@ -1,9 +1,12 @@
[submodule "vendor/midstream"]
path = vendor/midstream
url = https://github.com/ruvnet/midstream
branch = main
[submodule "vendor/ruvector"]
path = vendor/ruvector
url = https://github.com/ruvnet/ruvector
branch = main
[submodule "vendor/sublinear-time-solver"]
path = vendor/sublinear-time-solver
url = https://github.com/ruvnet/sublinear-time-solver
branch = main