-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (32 loc) · 945 Bytes
/
update-content.yml
File metadata and controls
37 lines (32 loc) · 945 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
name: Update Content Submodule
on:
repository_dispatch:
types: [content-updated]
workflow_dispatch:
permissions:
contents: write
jobs:
update-content:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ github.token }}
- name: Configure git
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
- name: Update submodule
run: |
git submodule update --init --remote src/content/writing
git add src/content/writing
git status --porcelain
if git diff --cached --quiet; then
echo "No content changes detected"
exit 0
else
echo "Content changes detected!"
git commit -m "Auto-update content submodule"
git push
fi