From 513a59eb9046a231db5d6f2835d0141b82185e71 Mon Sep 17 00:00:00 2001 From: Tobias Wolf Date: Thu, 2 Jul 2026 15:25:18 +0200 Subject: [PATCH] Fix artifact name used if `skipArchive` is set to false Signed-off-by: Tobias Wolf --- packages/artifact/__tests__/upload-artifact.test.ts | 6 +++--- packages/artifact/src/internal/upload/upload-artifact.ts | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/artifact/__tests__/upload-artifact.test.ts b/packages/artifact/__tests__/upload-artifact.test.ts index 9865815dc7..0edbc1a77a 100644 --- a/packages/artifact/__tests__/upload-artifact.test.ts +++ b/packages/artifact/__tests__/upload-artifact.test.ts @@ -589,7 +589,7 @@ describe('upload-artifact', () => { ) }) - it('should use the file basename as artifact name when skipArchive is true', async () => { + it('should use the artifact name as well when skipArchive is true', async () => { jest .spyOn(uploadZipSpecification, 'getUploadZipSpecification') .mockRestore() @@ -643,10 +643,10 @@ describe('upload-artifact', () => { {skipArchive: true} ) - // Verify CreateArtifact was called with the file basename, not the original name + // Verify CreateArtifact was called with the original name expect(createArtifactSpy).toHaveBeenCalledWith( expect.objectContaining({ - name: 'file1.txt' + name: 'original-name' }) ) }) diff --git a/packages/artifact/src/internal/upload/upload-artifact.ts b/packages/artifact/src/internal/upload/upload-artifact.ts index c7a6e60b75..984dee6f82 100644 --- a/packages/artifact/src/internal/upload/upload-artifact.ts +++ b/packages/artifact/src/internal/upload/upload-artifact.ts @@ -48,7 +48,6 @@ export async function uploadArtifact( } artifactFileName = path.basename(files[0]) - name = artifactFileName } validateArtifactName(name)