From 87f07835889b686aca1fb3733c2aa2d61586c1e1 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 22 Aug 2025 16:56:55 -0700 Subject: [PATCH] Enforce that required toolchain input is provided --- action.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index c68a596..b48984a 100644 --- a/action.yml +++ b/action.yml @@ -33,7 +33,11 @@ runs: - id: parse run: | : parse toolchain version - if [[ $toolchain =~ ^stable' '[0-9]+' '(year|month|week|day)s?' 'ago$ ]]; then + if [[ -z $toolchain ]]; then + # GitHub does not enforce `required: true` inputs itself. https://github.com/actions/runner/issues/1070 + echo "'toolchain' is a required input" >&2 + exit 1 + elif [[ $toolchain =~ ^stable' '[0-9]+' '(year|month|week|day)s?' 'ago$ ]]; then if [[ ${{runner.os}} == macOS ]]; then echo "toolchain=1.$((($(date -v-$(sed 's/stable \([0-9]*\) \(.\).*/\1\2/' <<< $toolchain) +%s)/60/60/24-16569)/7/6))" >> $GITHUB_OUTPUT else