gradle / gradle-build-action

Execute your Gradle build and trigger dependency submission
https://github.com/marketplace/actions/gradle-build-action
MIT License
679 stars 97 forks source link

Add feature to set artifact retention period #903

Closed DuncanCasteleyn closed 1 year ago

DuncanCasteleyn commented 1 year ago

Currently it does not seem possible to to set the artifact retention period on artifacts produced by this action, it would save storage cost if an option were added to set the retention period for artifacts produced by this action.

I'm referring specifically to a feature that is available in the official upload artifact action.

bigdaz commented 1 year ago

Thanks for the report, and for the PR. In general it would be nice to avoid adding another configuration option for this.

I think the ideal behaviour would be to remove the dependency graph artifact once it has been successfully uploaded to the Dependency Submission API. This would avoid the need for a user to configure anything and avoid storing the artifact unnecessarily. We could also set the default retention much lower (1 day). I'm not sure there's a use case where users would want to generate-and-preserve the dependency graph JSON, but there's nothing stopping them from saving the files separately in that case.

DuncanCasteleyn commented 1 year ago

Thanks for the report, and for the PR. In general it would be nice to avoid adding another configuration option for this.

I think the ideal behaviour would be to remove the dependency graph artifact once it has been successfully uploaded to the Dependency Submission API. This would avoid the need for a user to configure anything and avoid storing the artifact unnecessarily. We could also set the default retention much lower (1 day). I'm not sure there's a use case where users would want to generate-and-preserve the dependency graph JSON, but there's nothing stopping them from saving the files separately in that case.

Then I will set it permanently to 1

DuncanCasteleyn commented 1 year ago

Hi @bigdaz

Could you take a look at the PR and merge it if all good, we would like to use this, but also keep using the official action.

bigdaz commented 1 year ago

@DuncanCasteleyn After spending a bit of time looking at this, I wasn't comfortable simply defaulting to 1 day (even though that was my initial suggestion 🤦🏼 ).

I've pushed #953 which makes this configurable as you originally asked. I'll put out a v2.10.0 release with this functionality soon.

bigdaz commented 1 year ago

Pending a release, you can use the action with the latest changes. Use either gradle/gradle-build-action@main or gradle/gradle-build-action@9bca466e2722baf9e77b4f929bbe0af18848791f.

DuncanCasteleyn commented 1 year ago

Thanks, this will save us some trouble and cost in the future.