From 23e8c05539c54f42212593d4355d38786a58a506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Schl=C3=B6mer?= Date: Fri, 11 Mar 2022 11:35:40 +0100 Subject: [PATCH] add include/exclude --- LICENSE.txt | 2 +- README.md | 4 ++++ action.yml | 13 ++++++++++++- justfile | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 4d726c1..567d23b 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Nico Schlömer +Copyright (c) 2021-2022 Nico Schlömer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index d99bda2..1e7c758 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ Simply replace the above by ```yaml - name: Checkout code uses: nschloe/action-cached-lfs-checkout@v1 + # Use these to explicitly include/exclude files: + # with: + # include: "*" + # exclude: "" ``` Check it out [on the GitHub diff --git a/action.yml b/action.yml index ffef6ff..f6cd7dc 100644 --- a/action.yml +++ b/action.yml @@ -6,6 +6,16 @@ branding: icon: "download" color: "green" +inputs: + include: + description: "Explicitly include files for LFS" + required: false + default: "*" + exclude: + description: "Explicitly exclude files for LFS" + required: false + default: "" + runs: using: "composite" steps: @@ -13,7 +23,8 @@ runs: uses: actions/checkout@v2 - name: Create LFS file list - run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id + run: | + git lfs ls-files -l --include ${{ inputs.include }} --exclude ${{ inputs.exclude }}. | cut -d ' ' -f1 | sort > .lfs-assets-id shell: bash - name: Restore LFS cache diff --git a/justfile b/justfile index bdc3c40..60523e4 100644 --- a/justfile +++ b/justfile @@ -1,4 +1,4 @@ -version := "1.0.1" +version := "1.1.0" default: @echo "\"just publish\"?"