mirror of
https://code.forgejo.org/actions/upload-artifact.git
synced 2026-03-21 15:35:54 +03:00
fix: implement overwrite for skip archive artifact
When archive is set to false and overwrite is true, it now deletes existing artifact by filename before uploading new one.
This commit is contained in:
parent
bbbca2ddaa
commit
60f4f0971b
3 changed files with 43 additions and 2 deletions
|
|
@ -66,7 +66,16 @@ export async function run(): Promise<void> {
|
|||
}
|
||||
|
||||
if (inputs.overwrite) {
|
||||
await deleteArtifactIfExists(inputs.artifactName)
|
||||
if (!inputs.archive) {
|
||||
if (searchResult.filesToUpload.length > 0) {
|
||||
const fileName = searchResult.filesToUpload[0].split('/').pop()
|
||||
if (fileName) {
|
||||
deleteArtifactIfExists(fileName)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
await deleteArtifactIfExists(inputs.artifactName)
|
||||
}
|
||||
}
|
||||
|
||||
const options: UploadArtifactOptions = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue