Compare commits

...

5 Commits

Author SHA1 Message Date
peaceiris
bc2d1b14df feat: Add print_error 2019-09-22 16:21:48 +09:00
Shohei Ueda
deecf75ce0
Merge branch 'master' into fix/input-emptycommits 2019-09-22 16:18:24 +09:00
Shohei Ueda
45fd035794
Merge branch 'master' into fix/input-emptycommits 2019-09-22 14:42:09 +09:00
peaceiris
83bd255342 gha: Add fetch-depth 1 to actions/checkout 2019-09-22 12:35:59 +09:00
peaceiris
efee27b98b fix: Fixes #27 for docker hub image 2019-09-21 19:24:03 +09:00
2 changed files with 10 additions and 3 deletions

View File

@ -14,6 +14,8 @@ jobs:
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
- name: build
env:
@ -26,6 +28,8 @@ jobs:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
- name: shellcheck
run: shellcheck ./entrypoint.sh
@ -33,6 +37,8 @@ jobs:
runs-on: macOS-10.14
steps:
- uses: actions/checkout@master
with:
fetch-depth: 1
- name: hadolint
run: |
brew install hadolint

View File

@ -32,6 +32,7 @@ elif [ -n "${PERSONAL_TOKEN}" ]; then
elif [ -n "${GITHUB_TOKEN}" ]; then
print_info "setup with GITHUB_TOKEN"
print_error "Do not use GITHUB_TOKEN, See #9"
remote_repo="https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
@ -74,12 +75,12 @@ git add --all
print_info "Allowing empty commits: ${INPUT_EMPTYCOMMITS}"
COMMIT_MESSAGE="Automated deployment: $(date -u) ${GITHUB_SHA}"
if [[ ${INPUT_EMPTYCOMMITS} == "true" ]]; then
git commit --allow-empty -m "${COMMIT_MESSAGE}"
else
if [[ ${INPUT_EMPTYCOMMITS} == "false" ]]; then
git commit -m "${COMMIT_MESSAGE}" || \
print_info "No changes detected, skipping deployment" && \
exit 0
else
git commit --allow-empty -m "${COMMIT_MESSAGE}"
fi
git push origin "${remote_branch}"