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:
parent
c100db569a
commit
e95bba87d2
1 changed files with 55 additions and 50 deletions
|
@ -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"
|
||||||
|
|
Loading…
Add table
Reference in a new issue