Add file change check logic

This commit is contained in:
TheiLLeniumStudios
2023-02-06 10:17:08 +00:00
parent 8bd48aee05
commit d58e8ef837
2 changed files with 20 additions and 0 deletions
+15
View File
@@ -6,3 +6,18 @@ echo "$3"
echo "$4"
printenv
${GITHUB_SHA}
if [ ${GITHUB_BASE_REF} ]; then
# Pull Request
git fetch origin ${GITHUB_BASE_REF} --depth=1
export DIFF=$( git diff --name-only origin/${GITHUB_BASE_REF} ${GITHUB_SHA} )
echo "Diff between origin/${GITHUB_BASE_REF} and ${GITHUB_SHA}"
else
# Push
git fetch origin ${GITHUB_EVENT_BEFORE} --depth=1
export DIFF=$( git diff --name-only ${GITHUB_EVENT_BEFORE} ${GITHUB_SHA} )
echo "Diff between ${GITHUB_EVENT_BEFORE} and ${GITHUB_SHA}"
fi
echo "${DIFF}"