Update submodules #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |