Skip to content

child_updated

child_updated #18

name: Update submodules when a child repo changes
permissions:
contents: write
on:
repository_dispatch:
types: [child_updated]
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout portfolio repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Configure Git
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
- name: Update submodules to latest main
run: |
git submodule update --remote --force
- name: Commit changes
run: |
git add .
if git diff --cached --quiet; then
echo "No submodule updates"
exit 0
fi
git commit -m "Auto-update submodules from child repo change"
- name: Push changes
run: git push