]> source.dussan.org Git - gitea.git/commit
Artifacts retention and auto clean up (#26131)
authorFuXiaoHei <fuxiaohei@vip.qq.com>
Wed, 6 Sep 2023 07:41:06 +0000 (15:41 +0800)
committerGitHub <noreply@github.com>
Wed, 6 Sep 2023 07:41:06 +0000 (07:41 +0000)
commit460a2b0edffe71d9e64633beaa1071fcf4a33369
tree361d9adbf0db9bd12f72ac0034fdcdd2dcf65cfc
parent113eb5fc24f0890950167ca0dcc914bf858861ff
Artifacts retention and auto clean up (#26131)

Currently, Artifact does not have an expiration and automatic cleanup
mechanism, and this feature needs to be added. It contains the following
key points:

- [x] add global artifact retention days option in config file. Default
value is 90 days.
- [x] add cron task to clean up expired artifacts. It should run once a
day.
- [x] support custom retention period from `retention-days: 5` in
`upload-artifact@v3`.
- [x] artifacts link in actions view should be non-clickable text when
expired.
13 files changed:
custom/conf/app.example.ini
docs/content/administration/config-cheat-sheet.en-us.md
models/actions/artifact.go
models/migrations/migrations.go
models/migrations/v1_21/v274.go [new file with mode: 0644]
modules/setting/actions.go
options/locale/locale_en-US.ini
routers/api/actions/artifacts.go
routers/api/actions/artifacts_chunks.go
routers/web/repo/actions/view.go
services/actions/cleanup.go [new file with mode: 0644]
services/cron/tasks_basic.go
tests/integration/api_actions_artifact_test.go