Skip to content

Commit f8dd9fa

Browse files
committed
fix: Add skip function
1 parent 2cc02d4 commit f8dd9fa

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

entrypoint.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ function print_info() {
1111
echo -e "\e[36mINFO: ${1}\e[m"
1212
}
1313

14+
function skip() {
15+
print_info "No changes detected, skipping deployment"
16+
exit 0
17+
}
18+
1419
# check values
1520
if [ -n "${ACTIONS_DEPLOY_KEY}" ]; then
1621

@@ -76,9 +81,7 @@ git add --all
7681
print_info "Allowing empty commits: ${INPUT_EMPTYCOMMITS}"
7782
COMMIT_MESSAGE="Automated deployment: $(date -u) ${GITHUB_SHA}"
7883
if [[ ${INPUT_EMPTYCOMMITS} == "false" ]]; then
79-
git commit -m "${COMMIT_MESSAGE}" || \
80-
(print_info "No changes detected, skipping deployment" && \
81-
exit 0)
84+
git commit -m "${COMMIT_MESSAGE}" || skip
8285
else
8386
git commit --allow-empty -m "${COMMIT_MESSAGE}"
8487
fi

0 commit comments

Comments
 (0)