diff --git a/README.md b/README.md index 5427a50..87066a6 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,10 @@ When Git 2.18 or higher is not in your PATH, falls back to the REST API to downl # Default: true clean: '' + # Partially clone against a given filter. + # Default: null + filter: '' + # Do a sparse checkout on given patterns. Each pattern should be separated with # new lines # Default: null diff --git a/dist/index.js b/dist/index.js index 4556295..6d278ed 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1241,8 +1241,12 @@ function getSource(settings) { // Fetch core.startGroup('Fetching the repository'); const fetchOptions = {}; - if (settings.sparseCheckout) + if (settings.filter) { + fetchOptions.filter = settings.filter; + } + else if (settings.sparseCheckout) { fetchOptions.filter = 'blob:none'; + } if (settings.fetchDepth <= 0) { // Fetch all branches and tags let refSpec = refHelper.getRefSpecForAllHistory(settings.ref, settings.commit); @@ -1719,6 +1723,9 @@ function getInputs() { // Clean result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE'; core.debug(`clean = ${result.clean}`); + // Filter + result.filter = core.getInput('filter'); + core.debug(`filter = ${result.filter}`); // Sparse checkout const sparseCheckout = core.getMultilineInput('sparse-checkout'); if (sparseCheckout.length) {