diff --git a/.github/workflows/update-submodules.yml b/.github/workflows/update-submodules.yml new file mode 100644 index 00000000..76667163 --- /dev/null +++ b/.github/workflows/update-submodules.yml @@ -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 }} diff --git a/.gitmodules b/.gitmodules index e1dac42b..f52b04d9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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