forked from go-gitea/gitea
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'giteaofficial/main'
* giteaofficial/main: Fix schedule actions still running even if workflow disalbed (go-gitea#26939) Fix the missing repo count (go-gitea#26942) Improve SSH Key / GPG Key / Deploy Key UI (go-gitea#26949) [skip ci] Updated translations via Crowdin Update nginx recommendations (go-gitea#26924) docs: Update Profile README information (go-gitea#26947) Fix scoped label layout (go-gitea#26932) Move createrepository from module to service layer (go-gitea#26927) Add a documentation note for Windows Service (go-gitea#26938) allow "latest" to be used in release vTag when downloading file (go-gitea#26748) Extract common code to new template (go-gitea#26933) Show always repo count in header (go-gitea#26842) Show always repo count in header (go-gitea#26842) Artifacts retention and auto clean up (go-gitea#26131) Fix UI anomalies (go-gitea#26929) Fix the display of org level badges (go-gitea#26504)
- Loading branch information
Showing
69 changed files
with
962 additions
and
603 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2023 The Gitea Authors. All rights reserved. | ||
// SPDX-License-Identifier: MIT | ||
|
||
package v1_21 //nolint | ||
import ( | ||
"time" | ||
|
||
"code.gitea.io/gitea/modules/timeutil" | ||
|
||
"xorm.io/xorm" | ||
) | ||
|
||
func AddExpiredUnixColumnInActionArtifactTable(x *xorm.Engine) error { | ||
type ActionArtifact struct { | ||
ExpiredUnix timeutil.TimeStamp `xorm:"index"` // time when the artifact will be expired | ||
} | ||
if err := x.Sync(new(ActionArtifact)); err != nil { | ||
return err | ||
} | ||
return updateArtifactsExpiredUnixTo90Days(x) | ||
} | ||
|
||
func updateArtifactsExpiredUnixTo90Days(x *xorm.Engine) error { | ||
sess := x.NewSession() | ||
defer sess.Close() | ||
|
||
if err := sess.Begin(); err != nil { | ||
return err | ||
} | ||
expiredTime := time.Now().AddDate(0, 0, 90).Unix() | ||
if _, err := sess.Exec(`UPDATE action_artifact SET expired_unix=? WHERE status='2' AND expired_unix is NULL`, expiredTime); err != nil { | ||
return err | ||
} | ||
|
||
return sess.Commit() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.