mirror of
https://github.com/dtolnay/rust-toolchain.git
synced 2025-09-04 07:11:58 +03:00
Merge pull request #161 from dtolnay/required
Improve error message for missing `toolchain` input
This commit is contained in:
commit
79bae2f094
1 changed files with 5 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue