Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Commit

Permalink
Git repo data is missing (#124)
Browse files Browse the repository at this point in the history
* create the repo after the build to avoid overwrite
  • Loading branch information
helaili authored Feb 16, 2022
1 parent 1616330 commit 8db04b1
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,6 @@ if [ "${INPUT_KEEP_HISTORY}" = true ]; then
LOCAL_BRANCH=$remote_branch
PUSH_OPTIONS=""
COMMIT_OPTIONS="--allow-empty"
else
echo "::debug::Initializing new repo"
LOCAL_BRANCH="main"
git init -b $LOCAL_BRANCH
PUSH_OPTIONS="--force"
COMMIT_OPTIONS=""
fi

echo "::debug::Local branch is ${LOCAL_BRANCH}"
Expand Down Expand Up @@ -155,6 +149,15 @@ fi

cd ${BUILD_DIR}

# Initializing the repo now to prevent the Jekyll build from overwriting the .git folder
if [ "${INPUT_KEEP_HISTORY}" != true ]; then
echo "::debug::Initializing new repo"
LOCAL_BRANCH="main"
git init -b $LOCAL_BRANCH
PUSH_OPTIONS="--force"
COMMIT_OPTIONS=""
fi

# No need to have GitHub Pages to run Jekyll
touch .nojekyll

Expand Down

0 comments on commit 8db04b1

Please sign in to comment.