diff --git a/README.md b/README.md index 84597fc..7f3e681 100644 --- a/README.md +++ b/README.md @@ -135,3 +135,34 @@ uses: codespell-project/actions-codespell@v2 with: only_warn: 1 ``` + +### Parameter: regex + +Regular expression that is used to find words. + +This parameter is optional. + +### Parameter: files + +Files or directories to check. + +This parameter is optional. + +### Parameter: after_context + +Print a number of lines of trailing context. + +This parameter is optional. + +### Parameter: before_context + +Print a number of lines of leading context. + +This parameter is optional. + +### Parameter: context + +Print a number of lines of surrounding context. + +This parameter is optional. + diff --git a/action.yml b/action.yml index 59e4372..d02b84c 100644 --- a/action.yml +++ b/action.yml @@ -42,6 +42,26 @@ inputs: description: 'If set, only warn, never error' required: false default: '' + regex: + description: "Regular expression that is used to find words" + required: false + default: '' + files: + description: "Files or directories to check" + required: false + default: '' + after_context: + description: "Print a number of lines of trailing context" + required: false + default: '' + before_context: + description: "Print a number of lines of leading context" + required: false + default: '' + context: + description: "Print a number of lines of surrounding context" + required: false + default: '' runs: using: 'docker' image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh index 7c3d4ed..5ee9dd8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -44,6 +44,26 @@ echo "Ignore URI words list '${INPUT_URI_IGNORE_WORDS_LIST}'" if [ "x${INPUT_URI_IGNORE_WORDS_LIST}" != "x" ]; then command_args="${command_args} --uri-ignore-words-list ${INPUT_URI_IGNORE_WORDS_LIST}" fi +echo "Regular expression that is used to find words: '${INPUT_REGEX}'" +if [ "x${INPUT_REGEX}" != "x" ]; then + command_args="${command_args} --regex ${INPUT_REGEX}" +fi +echo "Files or directories to check: '${INPUT_FILES}'" +if [ "x${INPUT_FILES}" != "x" ]; then + command_args="${command_args} --regex ${INPUT_FILES}" +fi +echo "Print a number of lines of trailing context: '${INPUT_AFTER_CONTEXT}'" +if [ "x${INPUT_AFTER_CONTEXT}" != "x" ]; then + command_args="${command_args} --after-context ${INPUT_AFTER_CONTEXT}" +fi +echo "Print a number of lines of leading context: '${INPUT_BEFORE_CONTEXT}'" +if [ "x${INPUT_BEFORE_CONTEXT}" != "x" ]; then + command_args="${command_args} --before-context ${INPUT_BEFORE_CONTEXT}" +fi +echo "Print a number of lines of surrounding context: '${INPUT_CONTEXT}'" +if [ "x${INPUT_CONTEXT}" != "x" ]; then + command_args="${command_args} --context ${INPUT_CONTEXT}" +fi echo "Resulting CLI options ${command_args}" exec 5>&1 res=`{ { codespell --count ${command_args} ${INPUT_PATH}; echo $? 1>&4; } 1>&5; } 4>&1`