diff options
author | Zettat123 <zettat123@gmail.com> | 2024-01-31 15:55:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-31 15:55:12 +0100 |
commit | adc3598a755b43e3911266d7fa575c121e16613d (patch) | |
tree | ba5982153851b0b1267daae8d1a152d85448cd22 /services/wiki | |
parent | Fix doc img path in profile readme (#28994) (diff) | |
download | forgejo-adc3598a755b43e3911266d7fa575c121e16613d.tar.xz forgejo-adc3598a755b43e3911266d7fa575c121e16613d.zip |
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
Diffstat (limited to 'services/wiki')
-rw-r--r-- | services/wiki/wiki_path.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/services/wiki/wiki_path.go b/services/wiki/wiki_path.go index e51d6c630c..74c7064043 100644 --- a/services/wiki/wiki_path.go +++ b/services/wiki/wiki_path.go @@ -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), + } +} |