From 9ae2aee222cb69040e36df9dbc93ab69a5b942b7 Mon Sep 17 00:00:00 2001 From: Cotes Chung <11371340+cotes2020@users.noreply.github.com> Date: Tue, 26 Jan 2021 23:26:03 +0800 Subject: [PATCH] Improve the gh-actions CD script --- tools/deploy.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/deploy.sh b/tools/deploy.sh index 7a93e73..17a490a 100755 --- a/tools/deploy.sh +++ b/tools/deploy.sh @@ -16,7 +16,8 @@ init() { fi # Gemfile could be changed by `bundle install` in actions workflow - if [[ -n $(git status Gemfile.lock --porcelain) ]]; then + if [[ -n $(git ls-files | grep Gemfile.lock) && -n \ + $(git status Gemfile.lock --porcelain) ]]; then git checkout -- Gemfile.lock fi