diff --git a/Dockerfile b/Dockerfile index bee5730..6f6657e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Container image that runs your code FROM alpine:3.10 -RUN apk update && apk add git openssh-client +RUN apk update && apk add git git-lfs openssh-client # Copies your code file from your action repository to the filesystem path `/` of the container COPY entrypoint.sh /entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh index 486e2b9..7d0048c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -21,6 +21,9 @@ git config --global user.email "${INPUT_GIT_EMAIL}" ssh-keyscan -H github.com > ~/.ssh/known_hosts GIT_SSH='ssh -i /github/home/.ssh/id_rsa -o UserKnownHostsFile=/github/home/.ssh/known_hosts' +# Don't download LFS files initially +export GIT_LFS_SKIP_SMUDGE=1 + # clone the repo into our working directory and cd to it GIT_SSH_COMMAND=$GIT_SSH git clone git@github.com:$INPUT_DESTINATION_REPO.git $WORKING_DIR cd $WORKING_DIR @@ -31,6 +34,8 @@ git checkout $INPUT_DESTINATION_BRANCH || git checkout -b $INPUT_DESTINATION_BRA # ensure destination directory exists, and is emptied if appropriate mkdir -p $INPUT_DESTINATION_FOLDER cd $INPUT_DESTINATION_FOLDER +git lfs install + if [ "${INPUT_DELETE_DESTINATION}" = "true" ]; then git rm -rf . fi