From 88481de713af5c764e6ede094df379ab0705219f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20L=C3=B8hre?= <88767957+andreaslohre@users.noreply.github.com> Date: Mon, 26 Feb 2024 13:42:35 +0100 Subject: [PATCH 1/4] add lfs support --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From f4a4be0c869c001556b16d85c3d8efa3893c8ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20L=C3=B8hre?= <88767957+andreaslohre@users.noreply.github.com> Date: Mon, 26 Feb 2024 13:54:01 +0100 Subject: [PATCH 2/4] git lfs install --- entrypoint.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/entrypoint.sh b/entrypoint.sh index 486e2b9..a4a554d 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -16,6 +16,7 @@ echo "${INPUT_DEPLOY_KEY}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa # set up git +git lfs install git config --global user.name "${INPUT_GIT_USERNAME}" git config --global user.email "${INPUT_GIT_EMAIL}" ssh-keyscan -H github.com > ~/.ssh/known_hosts From 8479a4907ad53229c6e0a3ed151d77baf83aa05e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20L=C3=B8hre?= <88767957+andreaslohre@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:04:50 +0100 Subject: [PATCH 3/4] Update entrypoint.sh --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index a4a554d..e3bde5a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -16,7 +16,6 @@ echo "${INPUT_DEPLOY_KEY}" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa # set up git -git lfs install git config --global user.name "${INPUT_GIT_USERNAME}" git config --global user.email "${INPUT_GIT_EMAIL}" ssh-keyscan -H github.com > ~/.ssh/known_hosts @@ -32,6 +31,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 From 46f06029ce7894f97cffe7ec713aed53b3df0c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20L=C3=B8hre?= <88767957+andreaslohre@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:22:38 +0100 Subject: [PATCH 4/4] Update entrypoint.sh --- entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index e3bde5a..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