Support direct file uploads (#764)
Some checks are pending
Check dist/ / check-dist (push) Waiting to run
Code scanning - action / CodeQL-Build (push) Waiting to run
Licensed / Check licenses (push) Waiting to run
Test Proxy / test-proxy-upload (push) Waiting to run
Test / Build (push) Waiting to run
Test / Build-1 (push) Waiting to run
Test / Build-2 (push) Waiting to run
Test / Upload HTML Report (push) Waiting to run
Test / Merge (push) Blocked by required conditions
Test / Cleanup Artifacts (push) Blocked by required conditions
Some checks are pending
Check dist/ / check-dist (push) Waiting to run
Code scanning - action / CodeQL-Build (push) Waiting to run
Licensed / Check licenses (push) Waiting to run
Test Proxy / test-proxy-upload (push) Waiting to run
Test / Build (push) Waiting to run
Test / Build-1 (push) Waiting to run
Test / Build-2 (push) Waiting to run
Test / Upload HTML Report (push) Waiting to run
Test / Merge (push) Blocked by required conditions
Test / Cleanup Artifacts (push) Blocked by required conditions
* Cache licenses * Bump minimatch to 10.1.1 * Try fixing licenced issues * More licensed fixes * Support direct file uploads * Add CI tests for direct uploads * Use download-artifact@main temporarily * CI: clean up artifacts on successful runs * Use script v8 * Fix some issues with the cleanup * Add unit tests * Clarify naming
This commit is contained in:
parent
589182c5a4
commit
bbbca2ddaa
10 changed files with 242 additions and 14 deletions
13
dist/upload/index.js
vendored
13
dist/upload/index.js
vendored
|
|
@ -130457,6 +130457,7 @@ var Inputs;
|
|||
Inputs["CompressionLevel"] = "compression-level";
|
||||
Inputs["Overwrite"] = "overwrite";
|
||||
Inputs["IncludeHiddenFiles"] = "include-hidden-files";
|
||||
Inputs["Archive"] = "archive";
|
||||
})(Inputs || (Inputs = {}));
|
||||
var NoFileOptions;
|
||||
(function (NoFileOptions) {
|
||||
|
|
@ -130485,6 +130486,7 @@ function getInputs() {
|
|||
const path = getInput(Inputs.Path, { required: true });
|
||||
const overwrite = getBooleanInput(Inputs.Overwrite);
|
||||
const includeHiddenFiles = getBooleanInput(Inputs.IncludeHiddenFiles);
|
||||
const archive = getBooleanInput(Inputs.Archive);
|
||||
const ifNoFilesFound = getInput(Inputs.IfNoFilesFound);
|
||||
const noFileBehavior = NoFileOptions[ifNoFilesFound];
|
||||
if (!noFileBehavior) {
|
||||
|
|
@ -130495,7 +130497,8 @@ function getInputs() {
|
|||
searchPath: path,
|
||||
ifNoFilesFound: noFileBehavior,
|
||||
overwrite: overwrite,
|
||||
includeHiddenFiles: includeHiddenFiles
|
||||
includeHiddenFiles: includeHiddenFiles,
|
||||
archive: archive
|
||||
};
|
||||
const retentionDaysStr = getInput(Inputs.RetentionDays);
|
||||
if (retentionDaysStr) {
|
||||
|
|
@ -130576,6 +130579,11 @@ async function run() {
|
|||
const s = searchResult.filesToUpload.length === 1 ? '' : 's';
|
||||
info(`With the provided path, there will be ${searchResult.filesToUpload.length} file${s} uploaded`);
|
||||
core_debug(`Root artifact directory is ${searchResult.rootDirectory}`);
|
||||
// Validate that only a single file is uploaded when archive is false
|
||||
if (!inputs.archive && searchResult.filesToUpload.length > 1) {
|
||||
setFailed(`When 'archive' is set to false, only a single file can be uploaded. Found ${searchResult.filesToUpload.length} files to upload.`);
|
||||
return;
|
||||
}
|
||||
if (inputs.overwrite) {
|
||||
await deleteArtifactIfExists(inputs.artifactName);
|
||||
}
|
||||
|
|
@ -130586,6 +130594,9 @@ async function run() {
|
|||
if (typeof inputs.compressionLevel !== 'undefined') {
|
||||
options.compressionLevel = inputs.compressionLevel;
|
||||
}
|
||||
if (!inputs.archive) {
|
||||
options.skipArchive = true;
|
||||
}
|
||||
await upload_artifact_uploadArtifact(inputs.artifactName, searchResult.filesToUpload, searchResult.rootDirectory, options);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue