Skip to content

Commit 87f0783

Browse files
committed
Enforce that required toolchain input is provided
1 parent b3b07ba commit 87f0783

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

action.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ runs:
3333
- id: parse
3434
run: |
3535
: parse toolchain version
36-
if [[ $toolchain =~ ^stable' '[0-9]+' '(year|month|week|day)s?' 'ago$ ]]; then
36+
if [[ -z $toolchain ]]; then
37+
# GitHub does not enforce `required: true` inputs itself. https://github.com/actions/runner/issues/1070
38+
echo "'toolchain' is a required input" >&2
39+
exit 1
40+
elif [[ $toolchain =~ ^stable' '[0-9]+' '(year|month|week|day)s?' 'ago$ ]]; then
3741
if [[ ${{runner.os}} == macOS ]]; then
3842
echo "toolchain=1.$((($(date -v-$(sed 's/stable \([0-9]*\) \(.\).*/\1\2/' <<< $toolchain) +%s)/60/60/24-16569)/7/6))" >> $GITHUB_OUTPUT
3943
else

0 commit comments

Comments
 (0)