mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-06 01:05:54 -05:00
c99ec7784a
Don't skip processing the current item (FILE) before we give BuildFileArrays the chance to process it as an item to eventually add to the list of directories to lint with ansible-lint. Fix #5789 Other related changes - Add a new make target to open a shell in a Super-linter container. - Use a fixed path for FILE_ARRAYS_DIRECTORY_PATH so we can verify its contents in tests - Remove redundant ValidateBooleanVariable in buildFileList because we already check those variables in valudation. - Move Ansible directory detection to a function so we can reuse it. - Add missing exports for global configuration variables. - Remove unused LOG_XXXX variables from tests. These should have been deleted when we moved log variables to log.sh
54 lines
1.6 KiB
Bash
Executable file
54 lines
1.6 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -o errexit
|
|
set -o nounset
|
|
set -o pipefail
|
|
|
|
# shellcheck disable=SC2034
|
|
CREATE_LOG_FILE=false
|
|
# Default log level
|
|
# shellcheck disable=SC2034
|
|
LOG_LEVEL="DEBUG"
|
|
|
|
# shellcheck source=/dev/null
|
|
source "lib/functions/log.sh"
|
|
|
|
# shellcheck source=/dev/null
|
|
source "lib/functions/validation.sh"
|
|
# shellcheck source=/dev/null
|
|
source "lib/functions/githubEvent.sh"
|
|
|
|
function GetGithubPushEventCommitCountTest() {
|
|
local GITHUB_EVENT_COMMIT_COUNT
|
|
GITHUB_EVENT_COMMIT_COUNT=$(GetGithubPushEventCommitCount "test/data/github-event/github-event-push.json")
|
|
|
|
debug "GITHUB_EVENT_COMMIT_COUNT: ${GITHUB_EVENT_COMMIT_COUNT}"
|
|
|
|
if [ "${GITHUB_EVENT_COMMIT_COUNT}" -ne 1 ]; then
|
|
fatal "GITHUB_EVENT_COMMIT_COUNT is not equal to 1: ${GITHUB_EVENT_COMMIT_COUNT}"
|
|
fi
|
|
|
|
FUNCTION_NAME="${FUNCNAME[0]}"
|
|
notice "${FUNCTION_NAME} PASS"
|
|
}
|
|
|
|
GetGithubPushEventCommitCountTest
|
|
|
|
function GetGithubRepositoryDefaultBranchTest() {
|
|
local GITHUB_REPOSITORY_DEFAULT_BRANCH
|
|
GITHUB_REPOSITORY_DEFAULT_BRANCH=$(GetGithubRepositoryDefaultBranch "test/data/github-event/github-event-push.json")
|
|
|
|
debug "GITHUB_REPOSITORY_DEFAULT_BRANCH: ${GITHUB_REPOSITORY_DEFAULT_BRANCH}"
|
|
|
|
local EXPECTED_GITHUB_REPOSITORY_DEFAULT_BRANCH
|
|
EXPECTED_GITHUB_REPOSITORY_DEFAULT_BRANCH="main"
|
|
|
|
if [ "${GITHUB_REPOSITORY_DEFAULT_BRANCH}" != "${EXPECTED_GITHUB_REPOSITORY_DEFAULT_BRANCH}" ]; then
|
|
fatal "GITHUB_REPOSITORY_DEFAULT_BRANCH (${GITHUB_REPOSITORY_DEFAULT_BRANCH}) is not equal to: ${EXPECTED_GITHUB_REPOSITORY_DEFAULT_BRANCH}"
|
|
fi
|
|
|
|
FUNCTION_NAME="${FUNCNAME[0]}"
|
|
notice "${FUNCTION_NAME} PASS"
|
|
}
|
|
|
|
GetGithubRepositoryDefaultBranchTest
|