2021-05-21 12:39:56 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2021-12-04 11:11:27 +00:00
|
|
|
set -eu
|
2021-05-21 12:39:56 +00:00
|
|
|
|
2021-06-26 14:20:56 +00:00
|
|
|
echo "::group::changed-files"
|
|
|
|
|
2021-08-28 01:53:03 +00:00
|
|
|
echo "Resolving repository path..."
|
|
|
|
|
|
|
|
if [[ -n $INPUT_PATH ]]; then
|
|
|
|
REPO_DIR="$GITHUB_WORKSPACE/$INPUT_PATH"
|
|
|
|
if [[ ! -d "$REPO_DIR" ]]; then
|
|
|
|
echo "::warning::Invalid repository path"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
cd "$REPO_DIR"
|
|
|
|
fi
|
|
|
|
|
2021-09-26 06:32:59 +00:00
|
|
|
SERVER_URL=$(echo "$GITHUB_SERVER_URL" | awk -F/ '{print $3}')
|
|
|
|
|
2021-10-26 14:16:42 +00:00
|
|
|
echo "Setting up 'temp_changed_files' remote..."
|
|
|
|
|
|
|
|
git ls-remote --exit-code temp_changed_files 1>/dev/null 2>&1 && exit_status=$? || exit_status=$?
|
|
|
|
|
|
|
|
if [[ $exit_status -ne 0 ]]; then
|
|
|
|
echo "No 'temp_changed_files' remote found"
|
|
|
|
echo "Creating 'temp_changed_files' remote..."
|
2021-12-04 21:14:27 +00:00
|
|
|
git remote remove temp_changed_files 2>/dev/null || true
|
2021-10-26 14:16:42 +00:00
|
|
|
git remote add temp_changed_files "https://${INPUT_TOKEN}@${SERVER_URL}/${GITHUB_REPOSITORY}"
|
|
|
|
else
|
|
|
|
echo "Found 'temp_changed_files' remote"
|
|
|
|
fi
|
2021-05-21 12:39:56 +00:00
|
|
|
|
2021-06-09 21:52:54 +00:00
|
|
|
echo "Getting HEAD info..."
|
|
|
|
|
2021-07-14 20:57:17 +00:00
|
|
|
if [[ -z $INPUT_SHA ]]; then
|
2022-02-12 22:12:33 +00:00
|
|
|
CURRENT_SHA=$(git rev-list --no-merges -n 1 HEAD 2>&1) && exit_status=$? || exit_status=$?
|
2021-06-09 21:52:54 +00:00
|
|
|
else
|
2021-10-26 14:16:42 +00:00
|
|
|
CURRENT_SHA=$INPUT_SHA && exit_status=$? || exit_status=$?
|
2021-06-09 21:52:54 +00:00
|
|
|
fi
|
2021-05-21 12:39:56 +00:00
|
|
|
|
2021-12-04 11:11:27 +00:00
|
|
|
git rev-parse --quiet --verify "$CURRENT_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$?
|
|
|
|
|
2021-06-09 22:11:27 +00:00
|
|
|
if [[ $exit_status -ne 0 ]]; then
|
2021-12-04 11:11:27 +00:00
|
|
|
echo "::warning::Unable to locate the current sha: $CURRENT_SHA"
|
|
|
|
echo "::warning::You seem to be missing 'fetch-depth: 0' or 'fetch-depth: 2'. See https://github.com/tj-actions/changed-files#usage"
|
2021-10-27 11:30:47 +00:00
|
|
|
git remote remove temp_changed_files
|
2021-06-09 22:11:27 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-05-21 12:39:56 +00:00
|
|
|
if [[ -z $GITHUB_BASE_REF ]]; then
|
2021-10-30 19:55:58 +00:00
|
|
|
TARGET_BRANCH=${GITHUB_REF/refs\/heads\//}
|
|
|
|
CURRENT_BRANCH=$TARGET_BRANCH
|
|
|
|
|
2021-07-17 15:46:59 +00:00
|
|
|
if [[ -z $INPUT_BASE_SHA ]]; then
|
2022-02-12 22:12:33 +00:00
|
|
|
PREVIOUS_SHA=$(git rev-list --no-merges -n 1 HEAD^1 2>&1) && exit_status=$? || exit_status=$?
|
2021-07-17 15:46:59 +00:00
|
|
|
else
|
2021-10-30 19:55:58 +00:00
|
|
|
PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$?
|
2021-12-04 21:34:44 +00:00
|
|
|
TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
2021-07-17 15:46:59 +00:00
|
|
|
fi
|
2021-12-04 11:11:27 +00:00
|
|
|
|
|
|
|
git rev-parse --quiet --verify "$PREVIOUS_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$?
|
2021-08-28 01:53:03 +00:00
|
|
|
|
2021-06-09 22:11:27 +00:00
|
|
|
if [[ $exit_status -ne 0 ]]; then
|
2021-12-04 11:11:27 +00:00
|
|
|
echo "::warning::Unable to locate the previous sha: $PREVIOUS_SHA"
|
2021-06-09 22:11:27 +00:00
|
|
|
echo "::warning::You seem to be missing 'fetch-depth: 0' or 'fetch-depth: 2'. See https://github.com/tj-actions/changed-files#usage"
|
2021-10-27 11:30:47 +00:00
|
|
|
git remote remove temp_changed_files
|
2021-06-09 22:11:27 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2021-05-21 12:39:56 +00:00
|
|
|
else
|
2021-07-17 15:46:59 +00:00
|
|
|
TARGET_BRANCH=$GITHUB_BASE_REF
|
2021-06-25 18:58:59 +00:00
|
|
|
CURRENT_BRANCH=$GITHUB_HEAD_REF
|
2021-11-19 21:27:56 +00:00
|
|
|
|
2021-07-17 15:46:59 +00:00
|
|
|
if [[ -z $INPUT_BASE_SHA ]]; then
|
2021-12-04 11:11:27 +00:00
|
|
|
git fetch --no-tags -u --progress --depth=1 temp_changed_files "${TARGET_BRANCH}":"${TARGET_BRANCH}" && exit_status=$? || exit_status=$?
|
2022-02-12 22:12:33 +00:00
|
|
|
PREVIOUS_SHA=$(git rev-list --no-merges -n 1 "${TARGET_BRANCH}" 2>&1) && exit_status=$? || exit_status=$?
|
2021-07-17 15:46:59 +00:00
|
|
|
else
|
2021-12-04 11:11:27 +00:00
|
|
|
git fetch --no-tags -u --progress --depth=1 temp_changed_files "$INPUT_BASE_SHA" && exit_status=$? || exit_status=$?
|
2021-07-17 15:46:59 +00:00
|
|
|
PREVIOUS_SHA=$INPUT_BASE_SHA
|
2021-12-04 21:34:44 +00:00
|
|
|
TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
2021-07-17 15:46:59 +00:00
|
|
|
fi
|
2021-12-04 21:34:44 +00:00
|
|
|
|
2021-12-04 11:11:27 +00:00
|
|
|
git rev-parse --quiet --verify "$PREVIOUS_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$?
|
2021-08-28 01:53:03 +00:00
|
|
|
|
2021-06-09 22:11:27 +00:00
|
|
|
if [[ $exit_status -ne 0 ]]; then
|
2021-12-04 11:11:27 +00:00
|
|
|
echo "::warning::Unable to locate the previous sha: $PREVIOUS_SHA"
|
2021-11-19 21:27:56 +00:00
|
|
|
echo "::warning::You seem to be missing 'fetch-depth: 0' or 'fetch-depth: 2'. See https://github.com/tj-actions/changed-files#usage"
|
2021-10-27 11:30:47 +00:00
|
|
|
git remote remove temp_changed_files
|
2021-06-09 22:11:27 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
2021-05-21 12:39:56 +00:00
|
|
|
fi
|
|
|
|
|
2021-07-17 15:46:59 +00:00
|
|
|
echo "Retrieving changes between $PREVIOUS_SHA ($TARGET_BRANCH) → $CURRENT_SHA ($CURRENT_BRANCH)"
|
2021-05-25 04:30:19 +00:00
|
|
|
|
2021-12-04 11:11:27 +00:00
|
|
|
echo "Getting diff..."
|
|
|
|
|
2022-01-26 04:10:53 +00:00
|
|
|
if [[ -z "$INPUT_FILES_PATTERN" ]]; then
|
2022-02-10 01:05:29 +00:00
|
|
|
ADDED=$(git diff --submodule=diff --diff-filter=A --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
COPIED=$(git diff --submodule=diff --diff-filter=C --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
DELETED=$(git diff --submodule=diff --diff-filter=D --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
MODIFIED=$(git diff --submodule=diff --diff-filter=M --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
RENAMED=$(git diff --submodule=diff --diff-filter=R --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
TYPE_CHANGED=$(git diff --submodule=diff --diff-filter=T --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
UNMERGED=$(git diff --submodule=diff --diff-filter=U --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
UNKNOWN=$(git diff --submodule=diff --diff-filter=X --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
ALL_CHANGED_AND_MODIFIED=$(git diff --submodule=diff --diff-filter="*ACDMRTUX" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
ALL_CHANGED=$(git diff --submodule=diff --diff-filter="ACMR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
ALL_MODIFIED=$(git diff --submodule=diff --diff-filter="ACMRD" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
2021-05-21 12:39:56 +00:00
|
|
|
else
|
2022-01-26 04:10:53 +00:00
|
|
|
echo "Input files pattern: $INPUT_FILES_PATTERN"
|
2022-01-26 07:32:28 +00:00
|
|
|
FILES_PATTERN="^($INPUT_FILES_PATTERN)$"
|
|
|
|
|
2022-02-10 01:05:29 +00:00
|
|
|
ADDED=$(git diff --submodule=diff --diff-filter=A --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
COPIED=$(git diff --submodule=diff --diff-filter=C --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
DELETED=$(git diff --submodule=diff --diff-filter=D --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
MODIFIED=$(git diff --submodule=diff --diff-filter=M --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
RENAMED=$(git diff --submodule=diff --diff-filter=R --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
TYPE_CHANGED=$(git diff --submodule=diff --diff-filter=T --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
UNMERGED=$(git diff --submodule=diff --diff-filter=U --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
UNKNOWN=$(git diff --submodule=diff --diff-filter=X --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
ALL_CHANGED_AND_MODIFIED=$(git diff --submodule=diff --diff-filter="*ACDMRTUX" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
ALL_CHANGED=$(git diff --submodule=diff --diff-filter="ACMR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
ALL_MODIFIED=$(git diff --submodule=diff --diff-filter="ACMRD" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | grep -E "$FILES_PATTERN" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
|
|
|
|
ALL_OTHER_CHANGED=$(git diff --submodule=diff --diff-filter="ACMR" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
2022-01-25 01:50:47 +00:00
|
|
|
UNIQUE_ALL_CHANGED=$(echo "${ALL_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk '!a[$0]++' | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
2021-10-23 13:29:28 +00:00
|
|
|
|
2021-12-14 05:21:49 +00:00
|
|
|
if [[ -n "${UNIQUE_ALL_CHANGED}" ]]; then
|
2021-12-14 21:55:39 +00:00
|
|
|
echo "Matching changed files: ${UNIQUE_ALL_CHANGED}"
|
2021-05-21 12:39:56 +00:00
|
|
|
echo "::set-output name=any_changed::true"
|
|
|
|
else
|
|
|
|
echo "::set-output name=any_changed::false"
|
|
|
|
fi
|
2021-12-30 02:22:46 +00:00
|
|
|
|
|
|
|
OTHER_CHANGED=""
|
2021-07-17 19:13:26 +00:00
|
|
|
|
2021-12-14 07:01:31 +00:00
|
|
|
if [[ -n $ALL_OTHER_CHANGED ]]; then
|
|
|
|
if [[ -n "$UNIQUE_ALL_CHANGED" ]]; then
|
|
|
|
OTHER_CHANGED=$(echo "${ALL_OTHER_CHANGED}|${UNIQUE_ALL_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | sort | uniq -u | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
else
|
|
|
|
OTHER_CHANGED=$ALL_OTHER_CHANGED
|
|
|
|
fi
|
|
|
|
fi
|
2021-10-23 13:29:28 +00:00
|
|
|
|
2021-12-14 07:01:31 +00:00
|
|
|
OTHER_CHANGED=$(echo "${OTHER_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
|
|
|
|
if [[ -n "${OTHER_CHANGED}" ]]; then
|
|
|
|
echo "Non Matching changed files: ${OTHER_CHANGED}"
|
2021-07-17 19:13:26 +00:00
|
|
|
echo "::set-output name=only_changed::false"
|
2021-12-14 07:01:31 +00:00
|
|
|
echo "::set-output name=other_changed_files::$OTHER_CHANGED"
|
2021-12-14 05:21:49 +00:00
|
|
|
elif [[ -n "${UNIQUE_ALL_CHANGED}" ]]; then
|
2021-07-17 19:13:26 +00:00
|
|
|
echo "::set-output name=only_changed::true"
|
|
|
|
fi
|
2021-09-05 12:22:47 +00:00
|
|
|
|
2021-12-14 07:01:31 +00:00
|
|
|
ALL_OTHER_MODIFIED=$(git diff --diff-filter="ACMRD" --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
2022-01-25 01:50:47 +00:00
|
|
|
UNIQUE_ALL_MODIFIED=$(echo "${ALL_MODIFIED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk '!a[$0]++' | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
2021-09-05 12:22:47 +00:00
|
|
|
|
2021-12-14 07:01:31 +00:00
|
|
|
if [[ -n "${UNIQUE_ALL_MODIFIED}" ]]; then
|
|
|
|
echo "Matching modified files: ${UNIQUE_ALL_MODIFIED}"
|
|
|
|
echo "::set-output name=any_modified::true"
|
|
|
|
else
|
|
|
|
echo "::set-output name=any_modified::false"
|
|
|
|
fi
|
2021-12-30 02:22:46 +00:00
|
|
|
|
|
|
|
OTHER_MODIFIED=""
|
2021-12-14 07:01:31 +00:00
|
|
|
|
|
|
|
if [[ -n $ALL_OTHER_MODIFIED ]]; then
|
|
|
|
if [[ -n "$UNIQUE_ALL_MODIFIED" ]]; then
|
|
|
|
OTHER_MODIFIED=$(echo "${ALL_OTHER_MODIFIED}|${UNIQUE_ALL_MODIFIED}" | awk '{gsub(/\|/,"\n"); print $0;}' | sort | uniq -u | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
2021-10-23 13:29:28 +00:00
|
|
|
else
|
2021-12-14 07:01:31 +00:00
|
|
|
OTHER_MODIFIED=$ALL_OTHER_MODIFIED
|
2021-10-23 13:29:28 +00:00
|
|
|
fi
|
|
|
|
fi
|
2021-09-05 12:22:47 +00:00
|
|
|
|
2021-12-14 07:01:31 +00:00
|
|
|
OTHER_MODIFIED=$(echo "${OTHER_MODIFIED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
|
|
|
|
if [[ -n "${OTHER_MODIFIED}" ]]; then
|
|
|
|
echo "Non Matching modified files: ${OTHER_MODIFIED}"
|
|
|
|
echo "::set-output name=only_modified::false"
|
|
|
|
echo "::set-output name=other_modified_files::$OTHER_MODIFIED"
|
|
|
|
elif [[ -n "${UNIQUE_ALL_MODIFIED}" ]]; then
|
|
|
|
echo "::set-output name=only_modified::true"
|
|
|
|
fi
|
|
|
|
|
|
|
|
ALL_OTHER_DELETED=$(git diff --diff-filter=D --name-only "$PREVIOUS_SHA" "$CURRENT_SHA" | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
2022-01-25 01:50:47 +00:00
|
|
|
UNIQUE_ALL_DELETED=$(echo "${DELETED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk '!a[$0]++' | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
2021-09-05 12:22:47 +00:00
|
|
|
|
2021-10-23 13:29:28 +00:00
|
|
|
if [[ -n "${UNIQUE_ALL_DELETED}" ]]; then
|
2021-12-14 07:01:31 +00:00
|
|
|
echo "Matching deleted files: ${UNIQUE_ALL_DELETED}"
|
2021-09-05 12:22:47 +00:00
|
|
|
echo "::set-output name=any_deleted::true"
|
|
|
|
else
|
|
|
|
echo "::set-output name=any_deleted::false"
|
|
|
|
fi
|
2021-12-30 02:22:46 +00:00
|
|
|
|
|
|
|
OTHER_DELETED=""
|
2021-09-05 12:22:47 +00:00
|
|
|
|
2021-12-14 07:01:31 +00:00
|
|
|
if [[ -n $ALL_OTHER_DELETED ]]; then
|
|
|
|
if [[ -n "$UNIQUE_ALL_DELETED" ]]; then
|
2021-12-30 00:57:35 +00:00
|
|
|
OTHER_DELETED=$(echo "${ALL_OTHER_DELETED}|${UNIQUE_ALL_DELETED}" | awk '{gsub(/\|/,"\n"); print $0;}' | sort | uniq -u | awk -v d="|" '{s=(NR==1?s:s d)$0}END{print s}')
|
2021-12-14 07:01:31 +00:00
|
|
|
else
|
|
|
|
OTHER_DELETED=$ALL_OTHER_DELETED
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-10-23 13:29:28 +00:00
|
|
|
OTHER_DELETED=$(echo "${OTHER_DELETED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
|
|
|
|
if [[ -n "${OTHER_DELETED}" ]]; then
|
|
|
|
echo "Non Matching deleted files: ${OTHER_DELETED}"
|
2021-09-05 12:22:47 +00:00
|
|
|
echo "::set-output name=only_deleted::false"
|
2021-10-21 16:00:00 +00:00
|
|
|
echo "::set-output name=other_deleted_files::$OTHER_DELETED"
|
2021-10-23 13:29:28 +00:00
|
|
|
elif [[ -n "${UNIQUE_ALL_DELETED}" ]]; then
|
2021-09-05 12:22:47 +00:00
|
|
|
echo "::set-output name=only_deleted::true"
|
|
|
|
fi
|
2021-10-23 13:29:28 +00:00
|
|
|
|
|
|
|
ADDED=$(echo "${ADDED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
COPIED=$(echo "${COPIED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
DELETED=$(echo "${DELETED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
MODIFIED=$(echo "${MODIFIED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
RENAMED=$(echo "${RENAMED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
TYPE_CHANGED=$(echo "${TYPE_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
UNMERGED=$(echo "${UNMERGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
UNKNOWN=$(echo "${UNKNOWN}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
|
|
|
ALL_CHANGED_AND_MODIFIED=$(echo "${ALL_CHANGED_AND_MODIFIED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
2021-12-14 05:21:49 +00:00
|
|
|
ALL_CHANGED=$(echo "${ALL_CHANGED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
2021-12-14 07:01:31 +00:00
|
|
|
ALL_MODIFIED=$(echo "${ALL_MODIFIED}" | awk '{gsub(/\|/,"\n"); print $0;}' | awk -v d="$INPUT_SEPARATOR" '{s=(NR==1?s:s d)$0}END{print s}')
|
2021-05-21 12:39:56 +00:00
|
|
|
fi
|
|
|
|
|
2021-09-04 13:08:20 +00:00
|
|
|
echo "Added files: $ADDED"
|
|
|
|
echo "Copied files: $COPIED"
|
|
|
|
echo "Deleted files: $DELETED"
|
|
|
|
echo "Modified files: $MODIFIED"
|
|
|
|
echo "Renamed files: $RENAMED"
|
|
|
|
echo "Type Changed files: $TYPE_CHANGED"
|
|
|
|
echo "Unmerged files: $UNMERGED"
|
|
|
|
echo "Unknown files: $UNKNOWN"
|
2021-12-14 05:21:49 +00:00
|
|
|
echo "All changed and modified files: $ALL_CHANGED_AND_MODIFIED"
|
|
|
|
echo "All changed files: $ALL_CHANGED"
|
2021-12-14 07:01:31 +00:00
|
|
|
echo "All modified files: $ALL_MODIFIED"
|
2021-09-04 13:08:20 +00:00
|
|
|
|
2021-08-18 00:03:07 +00:00
|
|
|
git remote remove temp_changed_files
|
|
|
|
|
2021-05-21 12:39:56 +00:00
|
|
|
echo "::set-output name=added_files::$ADDED"
|
|
|
|
echo "::set-output name=copied_files::$COPIED"
|
|
|
|
echo "::set-output name=deleted_files::$DELETED"
|
|
|
|
echo "::set-output name=modified_files::$MODIFIED"
|
|
|
|
echo "::set-output name=renamed_files::$RENAMED"
|
2021-06-18 23:28:02 +00:00
|
|
|
echo "::set-output name=type_changed_files::$TYPE_CHANGED"
|
2021-05-21 12:39:56 +00:00
|
|
|
echo "::set-output name=unmerged_files::$UNMERGED"
|
|
|
|
echo "::set-output name=unknown_files::$UNKNOWN"
|
2021-09-04 13:42:11 +00:00
|
|
|
echo "::set-output name=all_changed_and_modified_files::$ALL_CHANGED_AND_MODIFIED"
|
2021-12-14 05:21:49 +00:00
|
|
|
echo "::set-output name=all_changed_files::$ALL_CHANGED"
|
2021-12-14 07:01:31 +00:00
|
|
|
echo "::set-output name=all_modified_files::$ALL_MODIFIED"
|
2021-06-26 14:20:56 +00:00
|
|
|
|
|
|
|
echo "::endgroup::"
|