Skip to content

fix(artifact): avoid zero-byte warning for empty raw-file uploads#2339

Open
mibragimov wants to merge 1 commit intoactions:mainfrom
mibragimov:fix/issue-2333
Open

fix(artifact): avoid zero-byte warning for empty raw-file uploads#2339
mibragimov wants to merge 1 commit intoactions:mainfrom
mibragimov:fix/issue-2333

Conversation

@mibragimov
Copy link

Summary

Suppress the zero-byte upload warning when uploading a valid empty file with skipArchive: true.

Root Cause

uploadToBlobStorage() warns whenever uploadByteCount === 0.
For raw-file uploads (skipArchive: true), uploading an empty file is a valid case, but progress remains 0 bytes and triggers the generic warning:

No data was uploaded to blob storage. Reported upload byte count is 0.

This warning is misleading because the upload succeeds and an empty file is expected to have zero bytes.

Fix

  • Added an internal BlobUploadOptions argument to uploadToBlobStorage with suppressZeroByteWarning.
  • In uploadArtifact, detect empty raw-file uploads (skipArchive: true and file size is 0) and pass suppressZeroByteWarning: true.
  • Keep warning behavior unchanged for all other upload paths.

Testing

  • Added a regression test in upload-artifact.test.ts:
    • should not warn when uploading an empty file with skipArchive enabled
  • Ran:
    • npm run lint
    • npx eslint packages/artifact/src/internal/upload/blob-upload.ts packages/artifact/src/internal/upload/upload-artifact.ts packages/artifact/__tests__/upload-artifact.test.ts
    • npx jest packages/artifact/__tests__/upload-artifact.test.ts --runInBand

Closes #2333

When uploadArtifact is called with skipArchive=true on an empty file,
blob upload progress remains at 0 bytes by design. The generic
zero-byte warning in uploadToBlobStorage incorrectly reports this as a
potential upload problem, even though the upload is valid.

Add an internal upload option to suppress the zero-byte warning for this
specific expected case. uploadArtifact now detects empty raw files and
passes suppressZeroByteWarning=true only for skipArchive empty-file
uploads.

Also add a regression test to verify that empty raw-file uploads do not
emit the warning.

Fixes actions#2333
@mibragimov mibragimov marked this pull request as ready for review March 7, 2026 14:25
@mibragimov mibragimov requested a review from a team as a code owner March 7, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[artifact] uploadArtifact({skipArchive:true}) warns when uploading zero-byte file

1 participant