-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (34 loc) · 1.16 KB
/
update-definitions.yml
File metadata and controls
41 lines (34 loc) · 1.16 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
40
41
name: Update definitions
on: workflow_call
jobs:
run:
name: Update definitions
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 }}
# We need `dfhack/library/xml` to be present.
submodules: recursive
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Generate definitions
run: bundle exec rake build
- name: Check if definitions changed
id: definitions_changed
run: echo "changed=$(git diff --quiet HEAD -- dist; echo $?)" >> $GITHUB_OUTPUT
- name: Setup git user
if: ${{ steps.definitions_changed.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.definitions_changed.outputs.changed == true }}
run: |
git add dist
git commit -m "Auto-update definitions"
git push