Skip to content
Latchkey

How to Upload a Single File as an Artifact in GitHub Actions

Point path at a single file and upload-artifact zips just that file under the artifact name.

Set path: to the exact file path. The action still produces a zip, with the single file inside it.

Steps

  • Produce the file you want to keep (for example app.log).
  • Set path: to that file, not its folder.
  • Download the artifact to get the zipped file back.

Workflow

.github/workflows/ci.yml
steps:
  - run: ./build.sh > build.log
  - uses: actions/upload-artifact@v4
    with:
      name: build-log
      path: build.log

Gotchas

  • The artifact is always a zip; even a single file is wrapped inside it.
  • The path is relative to the workspace unless you give an absolute path.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →