Skip to content

Commit b2adaea

Browse files
committed
🚧 Change tag validation
1 parent 6692128 commit b2adaea

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,9 @@ jobs:
3131
run: |
3232
set -euo pipefail
3333
tag="${{ github.ref_name }}"
34-
expected_mc_version="${{ steps.mod_data.outputs.minecraft_version }}"
35-
expected_mod_version="${{ steps.mod_data.outputs.mod_version }}"
36-
mc_version="$(printf '%s\n' "${tag:1}" | cut -d'-' -f1)"
37-
mod_version="$(printf '%s\n' "${tag:1}" | cut -d'-' -f2)"
38-
if [[ "${tag:0:1}" != "v" ]]; then
39-
echo "Tag must start with v"
40-
exit 1
41-
elif [[ "$mc_version" != "$expected_mc_version" ]]; then
42-
echo "The minecraft version in the tag does not match the gradle property"
43-
exit 1
44-
elif [[ "$mod_version" != "$expected_mod_version" ]]; then
45-
echo "The mod version in the tag does not match the gradle property"
34+
expected_tag="v${{ steps.mod_data.outputs.minecraft_version }}-${{ steps.mod_data.outputs.mod_version }}"
35+
if [[ "$tag" != "$expected_tag" ]]; then
36+
echo "Tag did not match expected result"
4637
exit 1
4738
fi
4839
echo "Tag validation sucessful!"

0 commit comments

Comments
 (0)