mirror of
https://gitea.com/actions/upload-artifact.git
synced 2026-04-06 05:59:47 +00:00
Support direct file uploads (#764)
* 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:
@@ -57,6 +57,14 @@ export async function run(): Promise<void> {
|
||||
)
|
||||
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) {
|
||||
core.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)
|
||||
}
|
||||
@@ -70,6 +78,10 @@ export async function run(): Promise<void> {
|
||||
options.compressionLevel = inputs.compressionLevel
|
||||
}
|
||||
|
||||
if (!inputs.archive) {
|
||||
options.skipArchive = true
|
||||
}
|
||||
|
||||
await uploadArtifact(
|
||||
inputs.artifactName,
|
||||
searchResult.filesToUpload,
|
||||
|
||||
Reference in New Issue
Block a user