From 6c1830ee18b882f167f9d01128783ddaa8e3f3bd Mon Sep 17 00:00:00 2001 From: Matt Bailey Date: Wed, 16 Nov 2022 22:45:40 -0800 Subject: [PATCH] feat: add check for event name for pull request checking --- entrypoint.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 46337c7..7f021a5 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -8,6 +8,9 @@ git config --global --add safe.directory /github/workspace echo "Generating site" hugo "$@" +[ "${GITHUB_EVENT_NAME}" == "pull_request" ] && \ + (echo "WARN: not deploying on pull_request" ; exit 0) + echo "Setting up git" [ -z "${GITHUB_TOKEN}" ] && \ (echo "ERROR: Missing GITHUB_TOKEN." ; exit 1) @@ -26,9 +29,3 @@ echo "commit & push" cd /tmp/gh-pages git add -A && git commit --allow-empty -am "Publishing from mattbailey/actions-hugo ${GITHUB_SHA}" git push - -#echo "Triggering second commit (for some gh-pages builds, two commits are required)." -#date -u > last_deploy.txt -#git add last_deploy.txt -#git commit -am "Publishing from mattbailey/actions-hugo ${GITHUB_SHA}" -#git push