mirror of
https://github.com/peaceiris/actions-gh-pages.git
synced 2025-07-15 06:33:17 +08:00
fix: Add skip function
This commit is contained in:
parent
2cc02d4c13
commit
f8dd9fac53
@ -11,6 +11,11 @@ function print_info() {
|
||||
echo -e "\e[36mINFO: ${1}\e[m"
|
||||
}
|
||||
|
||||
function skip() {
|
||||
print_info "No changes detected, skipping deployment"
|
||||
exit 0
|
||||
}
|
||||
|
||||
# check values
|
||||
if [ -n "${ACTIONS_DEPLOY_KEY}" ]; then
|
||||
|
||||
@ -76,9 +81,7 @@ git add --all
|
||||
print_info "Allowing empty commits: ${INPUT_EMPTYCOMMITS}"
|
||||
COMMIT_MESSAGE="Automated deployment: $(date -u) ${GITHUB_SHA}"
|
||||
if [[ ${INPUT_EMPTYCOMMITS} == "false" ]]; then
|
||||
git commit -m "${COMMIT_MESSAGE}" || \
|
||||
(print_info "No changes detected, skipping deployment" && \
|
||||
exit 0)
|
||||
git commit -m "${COMMIT_MESSAGE}" || skip
|
||||
else
|
||||
git commit --allow-empty -m "${COMMIT_MESSAGE}"
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user