Skip to content

Configure Git user for submodule update workflow #13

Configure Git user for submodule update workflow

Configure Git user for submodule update workflow #13

name: Update Submodules
on:
push:
branches:
- main
jobs:
update-submodules:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository with Submodules
uses: actions/checkout@v3
with:
submodules: recursive
- name: Configure Git User
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
- name: Configure Git to Auto-Reconcile Divergent Branches
run: |
git config submodule.recurse true
git config pull.rebase false # Change this based on your preferred strategy
git config --global pull.rebase false # For global configuration
- name: Update Submodules
run: |
git submodule update --init --recursive
git submodule foreach --recursive 'git pull origin $(git rev-parse --abbrev-ref HEAD) --allow-unrelated-histories'
git add .
git commit -m "Update submodule references" || echo "No changes to commit"
git push