From 0fbc4b771a173865a1ba8d32aa2dee55f7dbd380 Mon Sep 17 00:00:00 2001 From: Yang Cao Date: Mon, 8 Feb 2021 15:09:20 -0500 Subject: [PATCH 1/2] Display a warning if user tries to upload over 10000 files --- src/upload-artifact.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/upload-artifact.ts b/src/upload-artifact.ts index 4722be1..3add259 100644 --- a/src/upload-artifact.ts +++ b/src/upload-artifact.ts @@ -37,6 +37,12 @@ async function run(): Promise { ) core.debug(`Root artifact directory is ${searchResult.rootDirectory}`) + if (searchResult.filesToUpload.length > 10000) { + core.warning( + `There are over 10,000 files in this artifact, consider create an archive before upload to improve the upload performance.` + ) + } + const artifactClient = create() const options: UploadOptions = { continueOnError: false From e95d1b9c8db06f3ebbe7993730a352795b5f480a Mon Sep 17 00:00:00 2001 From: Yang Cao Date: Mon, 8 Feb 2021 15:41:35 -0500 Subject: [PATCH 2/2] update index.js --- dist/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dist/index.js b/dist/index.js index cbe3d64..ae4f0ef 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4078,6 +4078,9 @@ function run() { const s = searchResult.filesToUpload.length === 1 ? '' : 's'; core.info(`With the provided path, there will be ${searchResult.filesToUpload.length} file${s} uploaded`); core.debug(`Root artifact directory is ${searchResult.rootDirectory}`); + if (searchResult.filesToUpload.length > 10000) { + core.warning(`There are over 10,000 files in this artifact, consider create an archive before upload to improve the upload performance.`); + } const artifactClient = artifact_1.create(); const options = { continueOnError: false