mirror of
https://github.com/super-linter/super-linter.git
synced 2024-12-22 04:32:16 -05:00
fix, checkout DEFAULT_BRANCH for diff base (#1308)
This commit is contained in:
parent
11720172cb
commit
68c8bf9f11
1 changed files with 28 additions and 0 deletions
|
@ -68,6 +68,34 @@ function BuildFileList() {
|
||||||
# Need to build a list of all files changed
|
# Need to build a list of all files changed
|
||||||
# This can be pulled from the GITHUB_EVENT_PATH payload
|
# This can be pulled from the GITHUB_EVENT_PATH payload
|
||||||
|
|
||||||
|
################
|
||||||
|
# print header #
|
||||||
|
################
|
||||||
|
debug "----------------------------------------------"
|
||||||
|
debug "Pulling in code history and branches..."
|
||||||
|
|
||||||
|
#################################################################################
|
||||||
|
# Switch codebase back to the default branch to get a list of all files changed #
|
||||||
|
#################################################################################
|
||||||
|
SWITCH_CMD=$(
|
||||||
|
git -C "${GITHUB_WORKSPACE}" pull --quiet
|
||||||
|
git -C "${GITHUB_WORKSPACE}" checkout "${DEFAULT_BRANCH}" 2>&1
|
||||||
|
)
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# Load the error code #
|
||||||
|
#######################
|
||||||
|
ERROR_CODE=$?
|
||||||
|
|
||||||
|
##############################
|
||||||
|
# Check the shell for errors #
|
||||||
|
##############################
|
||||||
|
if [ ${ERROR_CODE} -ne 0 ]; then
|
||||||
|
# Error
|
||||||
|
info "Failed to switch to ${DEFAULT_BRANCH} branch to get files changed!"
|
||||||
|
fatal "[${SWITCH_CMD}]"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "${GITHUB_EVENT_NAME}" == "push" ]; then
|
if [ "${GITHUB_EVENT_NAME}" == "push" ]; then
|
||||||
################
|
################
|
||||||
# push event #
|
# push event #
|
||||||
|
|
Loading…
Reference in a new issue