Skip to content

Commit c8ba81e

Browse files
Merge pull request #2 from Amulet-Team/validate-inputs
Validate action inputs
2 parents cfc71a6 + ecb439c commit c8ba81e

File tree

5 files changed

+104
-4
lines changed

5 files changed

+104
-4
lines changed

.github/actions/install-dependencies/action.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,49 @@ inputs:
2828
runs:
2929
using: "composite"
3030
steps:
31+
- name: Validate Inputs
32+
shell: bash
33+
run: |
34+
if [ -z "${{ inputs.python-version }}" ]; then
35+
echo "python-version is empty"
36+
exit 1
37+
fi
38+
39+
if [ -z "${{ inputs.username }}" ]; then
40+
echo "username is empty"
41+
exit 1
42+
fi
43+
44+
if [ -z "${{ inputs.compiler-version-password }}" ]; then
45+
echo "compiler-version-password is empty"
46+
exit 1
47+
fi
48+
49+
if [ -z "${{ inputs.zlib-password }}" ]; then
50+
echo "zlib-password is empty"
51+
exit 1
52+
fi
53+
54+
if [ -z "${{ inputs.nbt-password }}" ]; then
55+
echo "nbt-password is empty"
56+
exit 1
57+
fi
58+
59+
if [ -z "${{ inputs.core-password }}" ]; then
60+
echo "core-password is empty"
61+
exit 1
62+
fi
63+
64+
if [ -z "${{ inputs.utils-password }}" ]; then
65+
echo "utils-password is empty"
66+
exit 1
67+
fi
68+
69+
if [ -z "${{ inputs.rest-token }}" ]; then
70+
echo "rest-token is empty"
71+
exit 1
72+
fi
73+
3174
- name: Set up Python ${{ inputs.python-version }}
3275
uses: actions/setup-python@v5
3376
with:

.github/actions/install/action.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,54 @@ outputs:
3535
runs:
3636
using: "composite"
3737
steps:
38+
- name: Validate Inputs
39+
shell: bash
40+
run: |
41+
if [ -z "${{ inputs.twine-username }}" ]; then
42+
echo "twine-username is empty"
43+
exit 1
44+
fi
45+
46+
if [ -z "${{ inputs.twine-password }}" ]; then
47+
echo "twine-password is empty"
48+
exit 1
49+
fi
50+
51+
if [ -z "${{ inputs.compiler-specifier }}" ]; then
52+
echo "compiler-specifier is empty"
53+
exit 1
54+
fi
55+
56+
if [ -z "${{ inputs.io-specifier }}" ]; then
57+
echo "io-specifier is empty"
58+
exit 1
59+
fi
60+
61+
if [ -z "${{ inputs.zlib-specifier }}" ]; then
62+
echo "zlib-specifier is empty"
63+
exit 1
64+
fi
65+
66+
if [ -z "${{ inputs.nbt-specifier }}" ]; then
67+
echo "nbt-specifier is empty"
68+
exit 1
69+
fi
70+
71+
if [ -z "${{ inputs.core-specifier }}" ]; then
72+
echo "core-specifier is empty"
73+
exit 1
74+
fi
75+
76+
if [ -z "${{ inputs.utils-specifier }}" ]; then
77+
echo "utils-specifier is empty"
78+
exit 1
79+
fi
80+
81+
if [ -z "${{ inputs.anvil-specifier }}" ]; then
82+
echo "anvil-specifier is empty"
83+
exit 1
84+
fi
85+
3886
- name: Install Prebuilt
3987
id: install
4088
shell: bash

.github/actions/unittests-src/action.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,18 @@ description: 'Build from source and run unittests.'
33
inputs:
44
python-version:
55
description: 'The version of Python to install'
6+
required: true
67
runs:
78
using: "composite"
89
steps:
10+
- name: Validate Inputs
11+
shell: bash
12+
run: |
13+
if [ -z "${{ inputs.python-version }}" ]; then
14+
echo "python-version is empty"
15+
exit 1
16+
fi
17+
918
- name: Set up Python ${{ inputs.python-version }}
1019
uses: actions/setup-python@v5
1120
with:

.github/workflows/python-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
fail-fast: false
1414
matrix:
15-
python-version: [ '3.11', '3.12', '3.13' ]
15+
python-version: [ '3.11', '3.12' ]
1616
os: [ macos-14, windows-latest ]
1717

1818
runs-on: ${{ matrix.os }}

.github/workflows/python-unittests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
python-version: [ '3.11', '3.12', '3.13' ]
22+
python-version: [ '3.11', '3.12' ]
2323
os: [ windows-latest, macos-latest ]
2424

2525
runs-on: ${{ matrix.os }}
@@ -66,7 +66,7 @@ jobs:
6666
strategy:
6767
fail-fast: false
6868
matrix:
69-
python-version: [ '3.11', '3.12', '3.13' ]
69+
python-version: [ '3.11', '3.12' ]
7070
os: [ ubuntu-latest ]
7171

7272
runs-on: ${{ matrix.os }}
@@ -92,7 +92,7 @@ jobs:
9292
strategy:
9393
fail-fast: false
9494
matrix:
95-
python-version: [ '3.11', '3.12', '3.13' ]
95+
python-version: [ '3.11', '3.12' ]
9696
os: [ windows-latest, macos-latest, ubuntu-latest ]
9797

9898
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)