diff --git a/README.md b/README.md index 826eb5be..50cf0069 100644 --- a/README.md +++ b/README.md @@ -283,7 +283,6 @@ But if you wish to select or exclude specific linters, we give you full control | **ACTIONS_RUNNER_DEBUG** | `false` | Flag to enable additional information about the linter, versions, and additional output. | | **ANSIBLE_CONFIG_FILE** | `.ansible-lint.yml` | Filename for [Ansible-lint configuration](https://ansible-lint.readthedocs.io/en/latest/configuring.html#configuration-file) (ex: `.ansible-lint`, `.ansible-lint.yml`) | | **ANSIBLE_DIRECTORY** | `/ansible` | Flag to set the root directory for Ansible file location(s), relative to `DEFAULT_WORKSPACE`. Set to `.` to use the top-level of the `DEFAULT_WORKSPACE`. | -| **ANSIBLE_ROLES_PATH** | `${ANSIBLE_DIRECTORY}/roles` | Path to the Ansible roles directory. | | **CSS_FILE_NAME** | `.stylelintrc.json` | Filename for [Stylelint configuration](https://github.com/stylelint/stylelint) (ex: `.stylelintrc.yml`, `.stylelintrc.yaml`) | | **DEFAULT_BRANCH** | `master` | The name of the repository default branch. | | **DEFAULT_WORKSPACE** | `/tmp/lint` | The location containing files to lint if you are running locally. | diff --git a/lib/functions/worker.sh b/lib/functions/worker.sh index ef88ecaf..209ec0f6 100755 --- a/lib/functions/worker.sh +++ b/lib/functions/worker.sh @@ -194,10 +194,12 @@ function LintCodebase() { # Check for ansible # ##################### if [[ ${FILE_TYPE} == "ANSIBLE" ]]; then + debug "ANSIBLE_DIRECTORY: ${ANSIBLE_DIRECTORY}, LINTER_COMMAND:${LINTER_COMMAND}, FILE: ${FILE}" LINT_CMD=$( - debug "ANSIBLE_ROLES_PATH: ${ANSIBLE_ROLES_PATH}, LINTER_COMMAND:${LINTER_COMMAND}, FILE: ${FILE}" - cd "${WORKSPACE_PATH}" || exit - ANSIBLE_ROLES_PATH=${ANSIBLE_ROLES_PATH} ${LINTER_COMMAND} "${FILE}" 2>&1 + cd "${ANSIBLE_DIRECTORY}" || exit + # Don't pass the file to lint to enable ansible-lint autodetection mode. + # See https://ansible-lint.readthedocs.io/usage for details + ${LINTER_COMMAND} 2>&1 ) #################################### # Corner case for pwsh subshell # diff --git a/lib/linter.sh b/lib/linter.sh index 21eec99a..5e2e1369 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -853,11 +853,6 @@ export DEFAULT_TEST_CASE_ANSIBLE_DIRECTORY ############################ GetValidationInfo -# Now ANSIBLE_DIRECTORY is set -ANSIBLE_ROLES_PATH="${ANSIBLE_ROLES_PATH:-"${ANSIBLE_DIRECTORY}/roles"}" -debug "Setting ANSIBLE_ROLES_PATH to: ${ANSIBLE_ROLES_PATH}..." -export ANSIBLE_ROLES_PATH - ################################# # Get the linter rules location # #################################