1
0
Fork 0
forked from forgejo/forgejo

Fix an actions schedule bug (#28942)

In #28691, schedule plans will be deleted when a repo's actions unit is
disabled. But when the unit is enabled, the schedule plans won't be
created again.

This PR fixes the bug. The schedule plans will be created again when the
actions unit is re-enabled

(cherry picked from commit adc3598a75)
This commit is contained in:
Zettat123 2024-01-31 22:55:12 +08:00 committed by Earl Warren
parent 3d19921dbe
commit cf78141bdd
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
7 changed files with 104 additions and 19 deletions

View file

@ -9,7 +9,10 @@ import (
"strings"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/modules/git"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/services/convert"
)
// To define the wiki related concepts:
@ -155,3 +158,15 @@ func UserTitleToWebPath(base, title string) WebPath {
}
return WebPath(title)
}
// ToWikiPageMetaData converts meta information to a WikiPageMetaData
func ToWikiPageMetaData(wikiName WebPath, lastCommit *git.Commit, repo *repo_model.Repository) *api.WikiPageMetaData {
subURL := string(wikiName)
_, title := WebPathToUserTitle(wikiName)
return &api.WikiPageMetaData{
Title: title,
HTMLURL: util.URLJoin(repo.HTMLURL(), "wiki", subURL),
SubURL: subURL,
LastCommit: convert.ToWikiCommit(lastCommit),
}
}