-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (54 loc) · 1.83 KB
/
update-submodules.yml
File metadata and controls
63 lines (54 loc) · 1.83 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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
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