mirror of
https://github.com/super-linter/super-linter.git
synced 2024-11-28 09:01:09 -05:00
docs: suggest setting fetch-depth on ref errors (#5316)
Emit a hopefully more helpful error message when the Git ref doesn't exist. The error message is the same we use when getting changed files only: it suggests checking that repository clone is not shallow, and that the full history is available. Additionally, when running on GitHub Actions, it also suggests checking the fetch-depth option of the actions/checkout step. Fix #5315
This commit is contained in:
parent
52b082b1f6
commit
608bd502d8
2 changed files with 2 additions and 0 deletions
|
@ -8,6 +8,7 @@ function IssueHintForFullGitHistory() {
|
|||
info "See https://github.com/super-linter/super-linter#get-started"
|
||||
info "Is shallow repository: $(git -C "${GITHUB_WORKSPACE}" rev-parse --is-shallow-repository)"
|
||||
}
|
||||
export -f IssueHintForFullGitHistory
|
||||
|
||||
function GenerateFileDiff() {
|
||||
local DIFF_GIT_DEFAULT_BRANCH_CMD
|
||||
|
|
|
@ -200,6 +200,7 @@ function ValidateGitShaReference() {
|
|||
|
||||
debug "Validate that the GITHUB_SHA reference (${GITHUB_SHA}) exists in this Git repository."
|
||||
if ! CheckIfGitRefExists "${GITHUB_SHA}"; then
|
||||
IssueHintForFullGitHistory
|
||||
fatal "The GITHUB_SHA reference (${GITHUB_SHA}) doesn't exist in this Git repository"
|
||||
else
|
||||
debug "The GITHUB_SHA reference (${GITHUB_SHA}) exists in this repository"
|
||||
|
|
Loading…
Reference in a new issue