File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 1
1
name : docker image ci
2
2
3
3
on :
4
+ pull_request :
5
+ types : [opened, synchronize]
4
6
push :
5
7
paths :
6
8
- ' **'
9
+ - ' .**'
7
10
- ' !LICENSE'
8
11
- ' !README.md'
9
12
- ' !images'
14
17
15
18
steps :
16
19
- uses : actions/checkout@master
20
+ with :
21
+ fetch-depth : 1
17
22
18
23
- name : build
19
24
env :
@@ -26,13 +31,17 @@ jobs:
26
31
runs-on : ubuntu-18.04
27
32
steps :
28
33
- uses : actions/checkout@master
34
+ with :
35
+ fetch-depth : 1
29
36
- name : shellcheck
30
37
run : shellcheck ./entrypoint.sh
31
38
32
39
hadolint :
33
40
runs-on : macOS-10.14
34
41
steps :
35
42
- uses : actions/checkout@master
43
+ with :
44
+ fetch-depth : 1
36
45
- name : hadolint
37
46
run : |
38
47
brew install hadolint
Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ function print_info() {
11
11
echo -e " \e[36mINFO: ${1} \e[m"
12
12
}
13
13
14
+ function skip() {
15
+ print_info " No changes detected, skipping deployment"
16
+ exit 0
17
+ }
18
+
14
19
# check values
15
20
if [ -n " ${ACTIONS_DEPLOY_KEY} " ]; then
16
21
@@ -32,6 +37,7 @@ elif [ -n "${PERSONAL_TOKEN}" ]; then
32
37
elif [ -n " ${GITHUB_TOKEN} " ]; then
33
38
34
39
print_info " setup with GITHUB_TOKEN"
40
+ print_error " Do not use GITHUB_TOKEN, See #9"
35
41
36
42
remote_repo=" https://x-access-token:${GITHUB_TOKEN} @github.com/${GITHUB_REPOSITORY} .git"
37
43
@@ -74,12 +80,10 @@ git add --all
74
80
75
81
print_info " Allowing empty commits: ${INPUT_EMPTYCOMMITS} "
76
82
COMMIT_MESSAGE=" Automated deployment: $( date -u) ${GITHUB_SHA} "
77
- if [[ ${INPUT_EMPTYCOMMITS} == " true " ]]; then
78
- git commit --allow-empty - m " ${COMMIT_MESSAGE} "
83
+ if [[ ${INPUT_EMPTYCOMMITS} == " false " ]]; then
84
+ git commit -m " ${COMMIT_MESSAGE} " || skip
79
85
else
80
- git commit -m " ${COMMIT_MESSAGE} " || \
81
- print_info " No changes detected, skipping deployment" && \
82
- exit 0
86
+ git commit --allow-empty -m " ${COMMIT_MESSAGE} "
83
87
fi
84
88
85
89
git push origin " ${remote_branch} "
You can’t perform that action at this time.
0 commit comments