Skip to content

Commit

Permalink
feat: fail when running in a shallow git repository
Browse files Browse the repository at this point in the history
  • Loading branch information
jamacku committed Jan 9, 2025
1 parent 06c922a commit 0f43ad2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ if ! [[ ${FULL_SCAN} -eq 0 ]] || ! is_strict_check_on_push_demanded; then
# https://github.com/actions/runner/issues/342
# Get the names of files from range of commits (excluding deleted files)
# BASE and HEAD are always set, it is checked inside pick_base_and_head_hash function
git diff --name-only -z --diff-filter=db "${BASE}".."${HEAD}" > "${WORK_DIR}changed-files.txt"
set -e
git diff --name-only -z --diff-filter=db "${BASE}".."abcdefgh" > "${WORK_DIR}changed-files.txt"
set +e

only_changed_scripts=()
get_scripts_for_scanning "${WORK_DIR}changed-files.txt" "only_changed_scripts"
Expand Down

0 comments on commit 0f43ad2

Please sign in to comment.