-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.23 KB
/
update-submodules.yml
File metadata and controls
47 lines (39 loc) · 1.23 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
# Nightly job that bumps every git submodule to the latest upstream HEAD
# and opens (or updates) a PR so the change goes through normal review.
name: Update submodules
on:
schedule:
# 03:00 UTC every day
- cron: "0 3 * * *"
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update:
name: Bump submodules to latest HEAD
runs-on: ubuntu-latest
steps:
- name: Checkout (no submodules)
uses: actions/checkout@v4
with:
submodules: false
- name: Update every submodule to remote HEAD
id: update
shell: bash
run: |
git submodule sync
git submodule update --init --remote --depth 1
if git diff --quiet HEAD; then
echo "changed=false" >> "$GITHUB_OUTPUT"
else
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Commit and push if changed
if: steps.update.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "chore: update submodules to latest HEAD"
git push origin HEAD:main