-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (33 loc) · 968 Bytes
/
sync-submodule.yml
File metadata and controls
38 lines (33 loc) · 968 Bytes
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
name: Sync Submodule
on:
schedule:
- cron: "0 */1 * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Update submodule to latest
run: |
git submodule update --init --recursive --remote
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Check for changes and commit
id: commit
run: |
if git diff --quiet; then
echo "No submodule updates"
echo "has_changes=false" >> $GITHUB_OUTPUT
else
git add part-of-my-brain
git commit -m "chore: sync part-of-my-brain submodule"
git push
echo "has_changes=true" >> $GITHUB_OUTPUT
fi