upload-artifact icon indicating copy to clipboard operation
upload-artifact copied to clipboard

Support transient/temporary artifacts with a retention period of 0

Open emilianbold opened this issue 6 years ago • 5 comments

Hello,

Some of my artifacts are transient. They transmit data between jobs but I don't want to keep them.

Ideally, I would like to use actions/upload-artifact like this:

- name: Upload artifact
  uses: actions/upload-artifact@v2
  with:
    name: myartifact
    path: mypath
    temporary: true

The temporary (or transient) flag would mark the artifact as transient and automatically delete it when the workflow is done.

emilianbold avatar Dec 23 '19 10:12 emilianbold

Ref #5.

eine avatar Dec 24 '19 03:12 eine

Related (I think this could be more useful if the sole purpose is to transmit data between jobs): https://github.com/actions/download-artifact/issues/20

If retention policies do get added, I'm thinking we'll be able to support this scenario. An expiration time of 0 or something could be used to denote that that artifact should be immediately deleted after the run is complete: https://github.com/actions/upload-artifact/issues/34

konradpabjan avatar Mar 23 '20 11:03 konradpabjan

You can now set artifact and log retention duration to 1 day and we will clean and delete artifacts right after they expire. You can learn more about this feature here. Feedback is welcome!

ahdbilal avatar Oct 10 '20 06:10 ahdbilal

You can now set artifact and log retention duration to 1 day and we will clean and delete artifacts right after they expire. You can learn more about this feature here. Feedback is welcome!

I still feel this is inadequate. I am currently working on developing my actions, and have, even using the 1 day expiration, nearly hit my limit on the plan. While this is due to some large artifacts, and needing to run the job many times in a short period, it is still a bother to have to go through and delete all of these artifacts by hand to keep working on developing the action. The ability to set an artifact to temporary, or to have retention-days:0 be "for this job only" would be very welcome.

Related (I think this could be more useful if the sole purpose is to transmit data between jobs): actions/download-artifact#20

The downside here is that if you have two jobs that run in parallel that use the artifact, which do you have delete it? If nothing else, a built in job to delete the artifact manually ( a first party one like actions/delete-artifact) would be very welcome.

deefdragon avatar Jan 20 '21 19:01 deefdragon

If I understand the OP, something like Jenkins' 'stash' would be ideal. It's an artifact that only persists for the workflow run. https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps/#stash-stash-some-files-to-be-used-later-in-the-build

neilhwatson avatar May 02 '22 14:05 neilhwatson