From 9f87b08578749e275bec28478234517632488cc3 Mon Sep 17 00:00:00 2001 From: Fabian Hauser Date: Sun, 29 Sep 2024 18:01:50 +0300 Subject: [PATCH] Add conditional lfs support --- action.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 1470f87..a03f5cc 100644 --- a/action.yml +++ b/action.yml @@ -5,6 +5,10 @@ inputs: description: 'OAUTH token to access repositories' required: false default: ${{ github.token }} + lfs: + description: 'Whether to enable lfs' + required: false + default: true runs: using: "composite" steps: @@ -15,10 +19,15 @@ runs: nix profile install nixpkgs#git-lfs nixpkgs#gnused mkdir -p ~/.config/nix && cp /etc/nix/nix.conf ~/.config/nix/ - - name: Checkout Repository + - name: Enable lfs + if: inputs.lfs == true shell: "nix shell nixpkgs#git-lfs nixpkgs#gnused --command {0}" run: | git lfs install + + - name: Checkout Repository + shell: "nix shell nixpkgs#git-lfs nixpkgs#gnused --command {0}" + run: | GIT_SERVER=`echo -n "$GITHUB_SERVER_URL" | sed "s%https://%%"` echo -e "machine $GIT_SERVER\nlogin oauth2\npassword ${{ inputs.token }}" > ~/.netrc # Disable clone protection to pull LFS as well