Skip to content

Commit

Permalink
feat: add check for event name for pull request checking
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbailey committed Nov 17, 2022
1 parent fdfa85c commit 6c1830e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

0 comments on commit 6c1830e

Please sign in to comment.