actions / actions/toolkit

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

Open
#2,333 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
A PR was recently merged to add the skipArchive option to uploadArtifact():

When uploading a zero-byte file with skipArchive:true, a warning is written, even if the upload was successful:

Beginning upload of artifact content to blob storage
Finished uploading artifact content to blob storage!
SHA256 digest of uploaded artifact is e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
Warning: No data was uploaded to blob storage. Reported upload byte count is 0.
Finalizing artifact upload

It should be possible to upload a zero-byte file with skipArchive:true with no warnings, either by default, or by disabling the warning.

Related issue in actions/upload-artifact:

To Reproduce

- run: truncate -s 0 zero.txt

- uses: actions/upload-artifact@v7
  with:
    name: zero-true
    path: zero.txt
    archive: true

- uses: actions/upload-artifact@v7
  with:
    name: zero-false
    path: zero.txt
    archive: false

Expected behavior
No warning, or the ability to disable the warning

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the uploadArtifact({skipArchive:true}) entry point and reproduce the zero-byte upload using the YAML steps in the issue. Done means a successful zero-byte upload produces no warning, or the warning can be disabled, for the relevant archive modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, typescript
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.