Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/update-submodules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Update Submodules

on:
schedule:
# Run every night at 2 AM UTC
- cron: '0 2 * * *'
workflow_dispatch: # Allow manual trigger

jobs:
update-submodules:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Update submodules to latest
id: update
run: |
# Update all submodules to their latest remote commits
git submodule update --remote --init --recursive

# Check if there are any changes
if git diff --quiet; then
echo "has_changes=false" >> "$GITHUB_OUTPUT"
echo "No submodule updates found"
else
echo "has_changes=true" >> "$GITHUB_OUTPUT"
echo "Submodule updates found:"
git diff --submodule=short

# Capture the diff for the PR body
{
echo "diff<<DIFF_EOF"
git diff --submodule=short
echo "DIFF_EOF"
} >> "$GITHUB_OUTPUT"
fi

- name: Create Pull Request
if: steps.update.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: update submodules"
title: "chore: Update submodules"
body: |
This PR updates submodules to their latest commits.

**Updated submodules:**
```
${{ steps.update.outputs.diff || 'See commit for details' }}
```

---
*This PR was automatically created by the update-submodules workflow.*
branch: automated/update-submodules
delete-branch: true
labels: |
automated
dependencies
Loading