Skip to content

Commit 183ae19

Browse files
authored
refactor: Update entrypoint.sh (#20)
1 parent b5f0514 commit 183ae19

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

entrypoint.sh

+8-10
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/bin/bash
2+
set -euo pipefail
23

34
ret_code=0
45

56
install_dependencies(){
6-
if [ "$RUNNER_OS" == "Linux" ]; then
7+
if [[ "$RUNNER_OS" == "Linux" ]]; then
78
# https://github.com/pypa/setuptools/issues/3269
89
export DEB_PYTHON_INSTALL_LAYOUT=deb
910
fi
@@ -12,16 +13,13 @@ install_dependencies(){
1213

1314
run_commit_check(){
1415
args=""
15-
if [ "$MESSAGE" == "true" ]; then
16+
if [[ "$MESSAGE" == "true" ]]; then
1617
args="$args --message"
17-
fi
18-
if [ "$BRANCH" == "true" ]; then
18+
elif [[ "$BRANCH" == "true" ]]; then
1919
args="$args --branch"
20-
fi
21-
if [ "$AUTHOR_NAME" == "true" ]; then
20+
elif [[ "$AUTHOR_NAME" == "true" ]]; then
2221
args="$args --author-name"
23-
fi
24-
if [ "$AUTHOR_EMAIL" == "true" ]; then
22+
elif [[ "$AUTHOR_EMAIL" == "true" ]]; then
2523
args="$args --author-email"
2624
fi
2725

@@ -31,7 +29,7 @@ run_commit_check(){
3129
}
3230

3331
add_job_summary(){
34-
if [ "$JOB_SUMMARY" == "false" ]; then
32+
if [[ "$JOB_SUMMARY" == "false" ]]; then
3533
exit
3634
fi
3735

@@ -54,7 +52,7 @@ install_dependencies
5452
run_commit_check
5553
add_job_summary
5654

57-
if [ "$DRY_RUN" == "true" ]; then
55+
if [[ "$DRY_RUN" == "true" ]]; then
5856
ret_code=0
5957
fi
6058

0 commit comments

Comments
 (0)