diff --git a/Dockerfile b/Dockerfile index a93c72bc..e6a9652d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,6 +116,7 @@ ENV GITHUB_SHA=${GITHUB_SHA} \ GITHUB_WORKSPACE=${GITHUB_WORKSPACE} \ DEFAULT_BRANCH=${DEFAULT_BRANCH} \ VALIDATE_ALL_CODEBASE=${VALIDATE_ALL_CODEBASE} \ + LINTER_PATH=${LINTER_PATH} \ VALIDATE_YAML=${VALIDATE_YAML} \ VALIDATE_JSON=${VALIDATE_JSON} \ VALIDATE_XML=${VALIDATE_XML} \ diff --git a/README.md b/README.md index 8e6d6f39..e1db8751 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ and won't run anything unexpected. | --- | --- | --- | | **VALIDATE_ALL_CODEBASE** | `true` | Will parse the entire repository and find all files to validate across all types. **NOTE:** When set to `false`, only **new** or **edited** files will be parsed for validation. | | **DEFAULT_BRANCH** | `master` | The name of the repository default branch. | +| **LINTER_PATH** | `.github/linters` | Directory for all linter configuration rules. | | **VALIDATE_YAML** | `true` |Flag to enable or disable the linting process of the language. | | **VALIDATE_JSON** | `true` | Flag to enable or disable the linting process of the language. | | **VALIDATE_XML** | `true` | Flag to enable or disable the linting process of the language. | diff --git a/lib/linter.sh b/lib/linter.sh index ca88f558..cbda9146 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -98,6 +98,7 @@ VALIDATE_CSS="${VALIDATE_CSS}" # Boolean to validate lang VALIDATE_ENV="${VALIDATE_ENV}" # Boolean to validate language TEST_CASE_RUN="${TEST_CASE_RUN}" # Boolean to validate only test cases DISABLE_ERRORS="${DISABLE_ERRORS}" # Boolean to enable warning-only output without throwing errors +LINTER_PATH="${LINTER_PATH}" # Linter Path Directory ############## # Debug Vars # @@ -569,6 +570,16 @@ GetGitHubVars() ############################### TEST_CASE_RUN=$(echo "$TEST_CASE_RUN" | awk '{print tolower($0)}') + ##################################### + # Get the Linter path # + ##################################### + if [ -z "$LINTER_PATH" ]; then + ################################### + # No flag passed, set to default # + ################################### + LINTER_PATH="$DEFAULT_LINTER_PATH" + fi + ########################## # Get the run local flag # ##########################