From 1e9bc18f8e3de7b12c4cd40bc21f06abb1af17c0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=81=AA=E3=81=A4=E3=81=8D?= <i@ntk.me>
Date: Wed, 21 Dec 2022 17:16:23 -0800
Subject: [PATCH] Print a warning if Gemfile's dependencies are not satisfied

---
 entrypoint.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/entrypoint.sh b/entrypoint.sh
index bb396ea..4bd6df0 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -13,6 +13,11 @@ DESTINATION_DIRECTORY=${GITHUB_WORKSPACE}/$INPUT_DESTINATION
 PAGES_GEM_HOME=$BUNDLE_APP_CONFIG
 GITHUB_PAGES=$PAGES_GEM_HOME/bin/github-pages
 
+# Check if Gemfile's dependencies are satisfied or print a warning 
+if test -e "$SOURCE_DIRECTORY/Gemfile" && ! bundle check --dry-run --gemfile "$SOURCE_DIRECTORY/Gemfile" >/dev/null 2>&1; then
+  echo "::warning:: github-pages can't satisfy your Gemfile's dependencies."
+fi
+
 # Set environment variables required by supported plugins
 export JEKYLL_ENV="production"
 export JEKYLL_GITHUB_TOKEN=$INPUT_TOKEN