mirror of
https://github.com/actions/upload-artifact.git
synced 2025-04-20 01:26:47 +00:00
Exclude hidden files by default
This commit is contained in:
parent
834a144ee9
commit
cb6558bb10
18 changed files with 169 additions and 36 deletions
16
dist/merge/index.js
vendored
16
dist/merge/index.js
vendored
|
@ -125727,6 +125727,7 @@ var Inputs;
|
|||
Inputs["RetentionDays"] = "retention-days";
|
||||
Inputs["CompressionLevel"] = "compression-level";
|
||||
Inputs["DeleteMerged"] = "delete-merged";
|
||||
Inputs["IncludeHiddenFiles"] = "include-hidden-files";
|
||||
})(Inputs = exports.Inputs || (exports.Inputs = {}));
|
||||
|
||||
|
||||
|
@ -125810,13 +125811,15 @@ function getInputs() {
|
|||
const pattern = core.getInput(constants_1.Inputs.Pattern, { required: true });
|
||||
const separateDirectories = core.getBooleanInput(constants_1.Inputs.SeparateDirectories);
|
||||
const deleteMerged = core.getBooleanInput(constants_1.Inputs.DeleteMerged);
|
||||
const includeHiddenFiles = core.getBooleanInput(constants_1.Inputs.IncludeHiddenFiles);
|
||||
const inputs = {
|
||||
name,
|
||||
pattern,
|
||||
separateDirectories,
|
||||
deleteMerged,
|
||||
retentionDays: 0,
|
||||
compressionLevel: 6
|
||||
compressionLevel: 6,
|
||||
includeHiddenFiles,
|
||||
};
|
||||
const retentionDaysStr = core.getInput(constants_1.Inputs.RetentionDays);
|
||||
if (retentionDaysStr) {
|
||||
|
@ -125932,7 +125935,7 @@ function run() {
|
|||
if (typeof inputs.compressionLevel !== 'undefined') {
|
||||
options.compressionLevel = inputs.compressionLevel;
|
||||
}
|
||||
const searchResult = yield (0, search_1.findFilesToUpload)(tmpDir);
|
||||
const searchResult = yield (0, search_1.findFilesToUpload)(tmpDir, inputs.includeHiddenFiles);
|
||||
yield (0, upload_artifact_1.uploadArtifact)(inputs.name, searchResult.filesToUpload, searchResult.rootDirectory, options);
|
||||
core.info(`The ${artifacts.length} artifact(s) have been successfully merged!`);
|
||||
if (inputs.deleteMerged) {
|
||||
|
@ -125999,11 +126002,12 @@ const fs_1 = __nccwpck_require__(57147);
|
|||
const path_1 = __nccwpck_require__(71017);
|
||||
const util_1 = __nccwpck_require__(73837);
|
||||
const stats = (0, util_1.promisify)(fs_1.stat);
|
||||
function getDefaultGlobOptions() {
|
||||
function getDefaultGlobOptions(_includeHiddenFiles) {
|
||||
return {
|
||||
followSymbolicLinks: true,
|
||||
implicitDescendants: true,
|
||||
omitBrokenSymbolicLinks: true
|
||||
omitBrokenSymbolicLinks: true,
|
||||
// excludeHiddenFiles: !includeHiddenFiles,
|
||||
};
|
||||
}
|
||||
/**
|
||||
|
@ -126057,10 +126061,10 @@ function getMultiPathLCA(searchPaths) {
|
|||
}
|
||||
return path.join(...commonPaths);
|
||||
}
|
||||
function findFilesToUpload(searchPath, globOptions) {
|
||||
function findFilesToUpload(searchPath, includeHiddenFiles) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const searchResults = [];
|
||||
const globber = yield glob.create(searchPath, globOptions || getDefaultGlobOptions());
|
||||
const globber = yield glob.create(searchPath, getDefaultGlobOptions(includeHiddenFiles || false));
|
||||
const rawSearchResults = yield globber.glob();
|
||||
/*
|
||||
Files are saved with case insensitivity. Uploading both a.txt and A.txt will files to be overwritten
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue