Upload-artifact: Specify shorter artifact retention time

Created on 28 Jan 2020  路  5Comments  路  Source: actions/upload-artifact

Hi,

This suggestion has been discussed here in the GitHub community forum. It can be considered as an extension of #45.

The current retention time for artifacts is 90 days. I suggest a more flexible artifact retention duration. I have setup nightly builds on my open source project. I certainly do not need those nightly builds to be retained for 90 days. Keeping the last 5 days (or so) is sufficient,

The current retention time of 90 days should be a default one and/or a maximum one. But a shorter period should be allowed, either in the settings of the repo or on an artifact basis, for instance something like this:
~
- name: Upload build
uses: actions/upload-artifact@master
with:
name: installer
path: installer.exe
retention-days: 5
~

enhancement retention

Most helpful comment

@lelegard Take a look at my https://github.com/kolpav/purge-artifacts-action . I already shared the link in few places but I feel it could help more people by also sharing it here judging by number of +1.

All 5 comments

@lelegard Take a look at my https://github.com/kolpav/purge-artifacts-action . I already shared the link in few places but I feel it could help more people by also sharing it here judging by number of +1.

Thanks for the suggestion @lelegard!

I think it would be really cool to have an input that allows you to specify the retention duration. Lots of different uses cases that this could help support.

Pretty similar to the following issue (keeping both open): https://github.com/actions/upload-artifact/issues/34

You can now change artifact and log retention duration either through Actions Settings tab or via YAML. You can learn more about this feature here. Feedback is welcome!

Thanks a lot @ahdbilal. This is exactly what I was looking for. I just added retention-days: 5 to all artifacts in my nightly build workflow. In 6 days from now, I will be able to check if the next nightly build disappears.

Hi @ahdbilal

After 6 days, the nightly build action now displays "The following artifacts have expired and are no longer able to be downloaded". The list of artifacts is still present but the artifact names are greyed and have no link.

We can close this one. Thanks for having implemented this.

Was this page helpful?
0 / 5 - 0 ratings