Update release.yml
This commit is contained in:
40
.github/workflows/release.yml
vendored
40
.github/workflows/release.yml
vendored
@@ -63,24 +63,26 @@ jobs:
|
|||||||
CHANGED_FILES_COUNT=$(git status --short | wc -l)
|
CHANGED_FILES_COUNT=$(git status --short | wc -l)
|
||||||
CHANGED_FILES_COUNT=${CHANGED_FILES_COUNT//[[:space:]]/}
|
CHANGED_FILES_COUNT=${CHANGED_FILES_COUNT//[[:space:]]/}
|
||||||
echo "Number of changed files: ${CHANGED_FILES_COUNT}"
|
echo "Number of changed files: ${CHANGED_FILES_COUNT}"
|
||||||
if [ "$CHANGED_FILES_COUNT" -eq 1 ]; then
|
if [ "${CHANGED_FILES_COUNT}" -ne 0 ]; then
|
||||||
DEPENDENCY_FILE=".3rd-party/DEPENDENCIES"
|
if [ "${CHANGED_FILES_COUNT}" -eq 1 ]; then
|
||||||
DEPENDENCIES_MODIFIED=$(git status --short | grep ".3rd-party/DEPENDENCIES")
|
DEPENDENCY_FILE=".3rd-party/DEPENDENCIES"
|
||||||
# Check if the file is modified
|
DEPENDENCIES_MODIFIED=$(git status --short | grep ".3rd-party/DEPENDENCIES")
|
||||||
if [[ -n "$DEPENDENCIES_MODIFIED" ]]; then
|
# Check if the file is modified
|
||||||
echo "${DEPENDENCY_FILE} changed - commit it"
|
if [[ -n "$DEPENDENCIES_MODIFIED" ]]; then
|
||||||
git config --local user.name "github-actions[bot]"
|
echo "${DEPENDENCY_FILE} changed - commit it"
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
git config --local user.name "github-actions[bot]"
|
||||||
git add ${DEPENDENCY_FILE} && git commit -m "[Release] Automated commit of ${DEPENDENCY_FILE} changes" && git push
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
else
|
git add ${DEPENDENCY_FILE} && git commit -m "[Release] Automated commit of ${DEPENDENCY_FILE} changes" && git push
|
||||||
echo "Unexpected changes:"
|
else
|
||||||
git status --short
|
echo "Unexpected changes:"
|
||||||
exit 1
|
git status --short
|
||||||
fi
|
exit 1
|
||||||
else
|
fi
|
||||||
echo "More than one file has changed:"
|
else
|
||||||
git status --short
|
echo "More than one file has changed:"
|
||||||
exit 1
|
git status --short
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
REVISION: ${{ github.event.inputs.revision }}
|
REVISION: ${{ github.event.inputs.revision }}
|
||||||
@@ -106,4 +108,4 @@ jobs:
|
|||||||
git tag -a ${REVISION} -m "Release version ${REVISION}" && git push origin ${REVISION}
|
git tag -a ${REVISION} -m "Release version ${REVISION}" && git push origin ${REVISION}
|
||||||
fi
|
fi
|
||||||
env:
|
env:
|
||||||
REVISION: ${{ github.event.inputs.revision }}
|
REVISION: ${{ github.event.inputs.revision }}
|
||||||
|
|||||||
Reference in New Issue
Block a user