-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (33 loc) · 1.08 KB
/
update-submodules.yml
File metadata and controls
39 lines (33 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Update submodules
on: workflow_call
jobs:
run:
name: Update submodules
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
# Cannot use the commit SHA because there may have been updates.
ref: ${{ github.ref }}
submodules: true
- name: Update submodules
run: |
git submodule update --remote
cd dfhack
git submodule update
- name: Check if submodules updated
id: submodules_updated
run: echo "changed=$(git diff --quiet HEAD -- dfhack; echo $?)" >> $GITHUB_OUTPUT
- name: Setup git user
if: ${{ steps.submodules_updated.outputs.changed == true }}
run: |
git config user.name "github-actions[bot]"
git config user.email ""41898282+github-actions[bot]@users.noreply.github.com""
- name: Commit changes
if: ${{ steps.submodules_updated.outputs.changed == true }}
run: |
git add dfhack
git commit -m "Auto-update submodules"
git push