0
1
Fork 0
mirror of https://github.com/actions/checkout synced 2024-06-18 14:38:20 +02:00

added build file

This commit is contained in:
Finley Garton 2023-06-30 17:15:03 +01:00
parent 99fc22de1f
commit 7e6f3d7a1e
No known key found for this signature in database
GPG key ID: 8D1E50A9A9B1C522
2 changed files with 12 additions and 1 deletions

View file

@ -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

9
dist/index.js vendored
View file

@ -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) {