Compare commits

..

2 Commits

Author SHA1 Message Date
peaceiris
f8dd9fac53 fix: Add skip function
Some checks failed
docker image ci / test (push) Has been cancelled
docker image ci / shellcheck (push) Has been cancelled
docker image ci / hadolint (push) Has been cancelled
2019-09-23 13:46:49 +09:00
peaceiris
2cc02d4c13 gha: Add pull_request trigger, close #32 2019-09-23 13:28:56 +09:00
2 changed files with 9 additions and 3 deletions

View File

@@ -1,9 +1,12 @@
name: docker image ci
on:
pull_request:
types: [opened, synchronize]
push:
paths:
- '**'
- '.**'
- '!LICENSE'
- '!README.md'
- '!images'

View File

@@ -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