Skip to content

Commit 5a25156

Browse files
committed
fix: make sure actions run in order
1 parent aa618b4 commit 5a25156

File tree

4 files changed

+56
-34
lines changed

4 files changed

+56
-34
lines changed

.github/workflows/hash-files.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Update Files
1+
name: Update Hashes
22

33
on:
44
push:

.github/workflows/update-gear.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,35 @@
1-
name: Update Files
1+
name: Update Gear
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
workflow_run:
5+
workflows: ["Update Items"]
6+
types:
7+
- completed
78

89
jobs:
9-
hash-files:
10+
check-items:
1011
if: ${{ github.repository_owner == 'WaspScripts' }}
12+
runs-on: ubuntu-latest
13+
outputs:
14+
changed: ${{ steps.file_check.outputs.changed }}
15+
steps:
16+
- name: Checkout repo
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 2
20+
21+
- name: Check if item files changed
22+
id: file_check
23+
run: |
24+
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^finders/items/data/item.txt$'; then
25+
echo "changed=true" >> $GITHUB_OUTPUT
26+
else
27+
echo "changed=false" >> $GITHUB_OUTPUT
28+
fi
29+
30+
process-gear:
31+
if: ${{ github.repository_owner == 'WaspScripts' && needs.check-items.outputs.changed == 'true'}}
32+
needs: check-items
1133
runs-on: windows-latest
1234
steps:
1335
- name: Fetch Simba 2 download URL
@@ -36,17 +58,6 @@ jobs:
3658
path: ./wasp-data
3759
fetch-depth: 2
3860

39-
- name: Check if item files changed
40-
id: file_check
41-
shell: bash
42-
working-directory: ./wasp-data
43-
run: |
44-
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^finders/items/data/item.txt$'; then
45-
echo "changed=true" >> $GITHUB_OUTPUT
46-
else
47-
echo "changed=false" >> $GITHUB_OUTPUT
48-
fi
49-
5061
- name: Generate new gear.json
5162
if: steps.file_check.outputs.changed == 'true'
5263
shell: bash

.github/workflows/update-items.yml

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,35 @@
1-
name: Update Files
1+
name: Update Items
22

33
on:
4-
push:
5-
branches:
6-
- main
4+
workflow_run:
5+
workflows: ["Update Hashes"]
6+
types:
7+
- completed
78

89
jobs:
9-
hash-files:
10+
check-items:
1011
if: ${{ github.repository_owner == 'WaspScripts' }}
12+
runs-on: ubuntu-latest
13+
outputs:
14+
changed: ${{ steps.file_check.outputs.changed }}
15+
steps:
16+
- name: Checkout repo
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 2
20+
21+
- name: Check if item files changed
22+
id: file_check
23+
run: |
24+
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^finders/items/data/item.txt$'; then
25+
echo "changed=true" >> $GITHUB_OUTPUT
26+
else
27+
echo "changed=false" >> $GITHUB_OUTPUT
28+
fi
29+
30+
process-items:
31+
if: ${{ github.repository_owner == 'WaspScripts' && needs.check-items.outputs.changed == 'true'}}
32+
needs: check-items
1133
runs-on: windows-latest
1234
steps:
1335
- name: Fetch Simba 2 download URL
@@ -35,17 +57,6 @@ jobs:
3557
with:
3658
path: ./wasp-data
3759
fetch-depth: 2
38-
39-
- name: Check if item files changed
40-
id: file_check
41-
shell: bash
42-
working-directory: ./wasp-data
43-
run: |
44-
if git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q '^finders/items/data/item.txt$'; then
45-
echo "changed=true" >> $GITHUB_OUTPUT
46-
else
47-
echo "changed=false" >> $GITHUB_OUTPUT
48-
fi
4960

5061
- name: Generate new item files
5162
if: steps.file_check.outputs.changed == 'true'

finders/items/data/item.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18037,4 +18037,4 @@ dwarf weed seed
1803718037
torstol seed
1803818038
torstol seed
1803918039
torstol seed
18040-
torstol seed
18040+
torstol Seed

0 commit comments

Comments
 (0)