Skip to content

Commit cd87887

Browse files
Update dev script to initialize and update git submodules
1 parent a1dbb71 commit cd87887

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Sync Submodule
2+
3+
on:
4+
# Run on schedule (every 12 hours)
5+
schedule:
6+
- cron: "0 */12 * * *"
7+
# Allow manual trigger
8+
workflow_dispatch:
9+
10+
jobs:
11+
sync:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
with:
17+
submodules: true
18+
fetch-depth: 0
19+
20+
- name: Update submodule to latest
21+
run: |
22+
git submodule update --init --recursive --remote
23+
git config user.name "github-actions[bot]"
24+
git config user.email "github-actions[bot]@users.noreply.github.com"
25+
26+
- name: Check for changes and commit
27+
id: commit
28+
run: |
29+
if git diff --quiet; then
30+
echo "No submodule updates"
31+
echo "has_changes=false" >> $GITHUB_OUTPUT
32+
else
33+
git add part-of-my-brain
34+
git commit -m "chore: sync part-of-my-brain submodule"
35+
git push
36+
echo "has_changes=true" >> $GITHUB_OUTPUT
37+
fi

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"type": "module",
44
"version": "0.0.1",
55
"scripts": {
6-
"dev": "astro dev",
6+
"dev": "git submodule update --init --recursive --remote && astro dev",
77
"build": "astro build",
88
"preview": "astro preview",
99
"astro": "astro"
@@ -12,4 +12,4 @@
1212
"astro": "^5.16.6",
1313
"remark-unwrap-images": "^5.0.0"
1414
}
15-
}
15+
}

0 commit comments

Comments
 (0)