Add conditional lfs support
This commit is contained in:
parent
f5bc4ffdef
commit
9f87b08578
1 changed files with 10 additions and 1 deletions
11
action.yml
11
action.yml
|
@ -5,6 +5,10 @@ inputs:
|
||||||
description: 'OAUTH token to access repositories'
|
description: 'OAUTH token to access repositories'
|
||||||
required: false
|
required: false
|
||||||
default: ${{ github.token }}
|
default: ${{ github.token }}
|
||||||
|
lfs:
|
||||||
|
description: 'Whether to enable lfs'
|
||||||
|
required: false
|
||||||
|
default: true
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
|
@ -15,10 +19,15 @@ runs:
|
||||||
nix profile install nixpkgs#git-lfs nixpkgs#gnused
|
nix profile install nixpkgs#git-lfs nixpkgs#gnused
|
||||||
mkdir -p ~/.config/nix && cp /etc/nix/nix.conf ~/.config/nix/
|
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}"
|
shell: "nix shell nixpkgs#git-lfs nixpkgs#gnused --command {0}"
|
||||||
run: |
|
run: |
|
||||||
git lfs install
|
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://%%"`
|
GIT_SERVER=`echo -n "$GITHUB_SERVER_URL" | sed "s%https://%%"`
|
||||||
echo -e "machine $GIT_SERVER\nlogin oauth2\npassword ${{ inputs.token }}" > ~/.netrc
|
echo -e "machine $GIT_SERVER\nlogin oauth2\npassword ${{ inputs.token }}" > ~/.netrc
|
||||||
# Disable clone protection to pull LFS as well
|
# Disable clone protection to pull LFS as well
|
||||||
|
|
Loading…
Reference in a new issue