3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2025-02-06 09:41:22 +00:00

Add warning message when the head sha is empty (#56)

This commit is contained in:
Tonye Jack 2021-05-08 19:30:57 -04:00 committed by GitHub
parent c100db569a
commit e95bba87d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,6 +73,10 @@ runs:
HEAD_SHA=$(git rev-parse "${TARGET_BRANCH}" || true) HEAD_SHA=$(git rev-parse "${TARGET_BRANCH}" || true)
fi fi
if [[ -z $HEAD_SHA ]]; then
echo "::warning::Unable to determine the head sha: $HEAD_SHA."
echo "::warning::You seem to be misssing `fetch-depth: 0` or `fetch-depth: 2`"
else
echo "Using head sha: $HEAD_SHA..." echo "Using head sha: $HEAD_SHA..."
if [[ -z "$INPUT_FILES" ]]; then if [[ -z "$INPUT_FILES" ]]; then
@ -126,6 +130,7 @@ runs:
ALL_CHANGED=$(echo "${ALL_CHANGED_ARRAY[@]}" | sed -E "s/($INPUT_SEPARATOR)$//" | xargs) ALL_CHANGED=$(echo "${ALL_CHANGED_ARRAY[@]}" | sed -E "s/($INPUT_SEPARATOR)$//" | xargs)
ALL_MODIFIED_FILES=$(echo "${ALL_MODIFIED_FILES_ARRAY[@]}" | sed -E "s/($INPUT_SEPARATOR)$//" | xargs) ALL_MODIFIED_FILES=$(echo "${ALL_MODIFIED_FILES_ARRAY[@]}" | sed -E "s/($INPUT_SEPARATOR)$//" | xargs)
fi fi
fi
echo "Added files: $ADDED" echo "Added files: $ADDED"
echo "Copied files: $COPIED" echo "Copied files: $COPIED"