Skip to content

Update Content Submodule #53

Update Content Submodule

Update Content Submodule #53

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