Skip to content

Update submodules

Update submodules #7

name: Update submodules
on:
schedule:
- cron: '0 12 * * *'
workflow_dispatch:
jobs:
run:
name: Update submodules
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Update submodules
run: git submodule update --remote
- name: Check if submodules updated
id: submodules_updated
run: echo "changed=$(git diff --quiet HEAD -- dfhack df-structures; echo $?)" >> $GITHUB_OUTPUT
- name: Setup git user
if: ${{ steps.submodules_updated.outputs.changed == true }}
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Commit changes
if: ${{ steps.submodules_updated.outputs.changed == true }}
run: |
git add dfhack df-structures
git commit -m "Auto-update submodules"
git push