From ea8d6f637b5fe3151c45f9e0ebd4ea914de60d15 Mon Sep 17 00:00:00 2001 From: Josh Soref Date: Tue, 22 Jun 2021 10:22:36 -0400 Subject: [PATCH] Act add empty dictionary url handling https://github.com/nektos/act/issues/655 --- .../spelling/expect/unknown-words.sh.txt | 2 ++ unknown-words.sh | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/.github/actions/spelling/expect/unknown-words.sh.txt b/.github/actions/spelling/expect/unknown-words.sh.txt index 2197e58bd..bc24f6c2c 100644 --- a/.github/actions/spelling/expect/unknown-words.sh.txt +++ b/.github/actions/spelling/expect/unknown-words.sh.txt @@ -17,6 +17,7 @@ junit mailto metadata mktemp +nektos perl pid PIPESTATUS @@ -32,3 +33,4 @@ url vnd whitelist xargs +yml diff --git a/unknown-words.sh b/unknown-words.sh index 282a02cae..841cb6602 100755 --- a/unknown-words.sh +++ b/unknown-words.sh @@ -608,6 +608,30 @@ set_up_files() { if [ ! -s "$dict" ]; then DICTIONARY_VERSION=${DICTIONARY_VERSION:-$INPUT_DICTIONARY_VERSION} DICTIONARY_URL=${DICTIONARY_URL:-$INPUT_DICTIONARY_URL} + if [ -z "$DICTIONARY_URL" ] && [ -n "$ACT" ]; then + ( + echo "This workflow appears to be running under nektos/act" + echo "Unfortunately, this run has hit: https://github.com/nektos/act/issues/655" + echo + echo "In order to run locally, please use:" + echo + echo " with:" + echo " dictionary_url: fill_this_in" + if [ -z "$INPUT_CONFIG" ]; then + echo " config: fill_this_in" + fi + if [ -z "$INPUT_DICTIONARY_ALIASES" ]; then + echo " dictionary_source_prefixes: fill_this_in" + fi + if [ -z "$INPUT_DICTIONARY_VERSION" ]; then + echo " dictionary_version: fill_this_in" + fi + echo + echo "You can use the defaults from https://github.com/check-spelling/check-spelling/blob/HEAD/action.yml" + echo "Note: you may need to omit backslashes for the dictionary_url." + ) >&2 + exit 1 + fi eval download_or_quit_with_error "$DICTIONARY_URL" "$dict" fi get_project_files allow $allow_path