pitosalas
pitosalas

Reputation: 10862

Upload vs. Download vs. Artifacts

I have an action which runs a program and that program generates a file graph.png.

I would like to have that file appear in the same GitHub repo so that it is available to me when I git pull.

The polarity and functionality of artifact upload and download is confusing. What am I uploading? From what to what? What am I downloading?

Upvotes: 3

Views: 722

Answers (1)

VonC
VonC

Reputation: 1323943

The documentation "Persisting workflow data using artifacts" gives some clues:

Artifacts allow you to persist data after a job has completed.
An artifact is a file or collection of files produced during a workflow run.
You can use artifacts to pass data between jobs in a workflow or persist build and test output after a workflow run has ended

But:

GitHub stores artifacts for 90 days for pushes and pull requests.
(The retention period for a pull request restarts each time someone pushes new commits to the pull request.)

So:

  • said artifact might not always be there when you pull.
  • said artifact won't be in the same repository, but is stored elsewhere, and is associated to job (action) execution.

You might rather create a release actions/create-release and store your artifact as a release asset.

Like artifact, it won't exactly appear in the same GitHub repository, but it can be queried, through its asset ID (listed from the release)


To truly add a new files, you would need the "Add & Commit" GitHub Action

That would ensure a future clone or pull of your repository would include the file you want.

Upvotes: 1

Related Questions