66 inputs :
77 wurst_version :
88 description : " Wurst version (without v or -MC)"
9- required : true
109 type : string
10+ required : true
1111 branches :
1212 description : " Space-separated list of branches to publish from"
13- required : true
1413 type : string
14+ required : true
1515 announce_update :
1616 description : " Announce as an update on WurstForum"
17- required : true
1817 type : boolean
1918 default : false
2019 announce_ports :
2120 description : " Announce as ports on WurstForum"
22- required : true
2321 type : boolean
2422 default : false
2523 dry_run :
2624 description : " Dry-run mode (don't actually publish anything)"
27- required : false
2825 type : boolean
2926 default : false
3027
4744 JSON_ARRAY="[${quoted_branches%,}]"
4845 echo "branches=$JSON_ARRAY" >> "$GITHUB_OUTPUT"
4946 echo "Branches: $JSON_ARRAY" >> "$GITHUB_STEP_SUMMARY"
47+ - name : Verify mod_version is as expected
48+ run : |
49+ expected_prefix="v${{ inputs.wurst_version }}-MC"
50+ for branch in ${{ inputs.branches }}; do
51+ url="https://raw.githubusercontent.com/${{ github.repository }}/${branch}/gradle.properties"
52+ actual=$(curl -sf "$url" | grep "^mod_version=" | cut -d'=' -f2)
53+ echo "$branch: $actual"
54+ [[ "$actual" == "$expected_prefix"* ]] || { echo "::error::Expected $expected_prefix*, got $actual"; exit 1; }
55+ done
5056
5157 publish_each :
5258 runs-on : ubuntu-latest
@@ -62,14 +68,13 @@ jobs:
6268 fail-fast : true
6369 matrix :
6470 branch : ${{ fromJson(needs.prepare.outputs.branches) }}
65- # TODO: Maybe also verify that the wurst_version in each branch is as expected before publishing?
6671 steps :
6772 - name : Trigger publish workflow
6873 uses : Wurst-Imperium/dispatch-and-wait@v1
6974 with :
7075 token : ${{ github.token }}
71- owner : Wurst-Imperium
72- repo : Wurst7
76+ owner : ${{ github.repository_owner }}
77+ repo : ${{ github.event.repository.name }}
7378 ref : ${{ matrix.branch }}
7479 workflow : publish.yml
7580 workflow_inputs : |
0 commit comments