mirror of
https://github.com/go-gitea/gitea
synced 2025-07-10 04:27:22 +00:00
show workflow config error on file view also (#24267)
As title, follow #24124  --------- Signed-off-by: a1012112796 <1012112796@qq.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@ -29,6 +29,14 @@ func init() {
|
||||
}
|
||||
}
|
||||
|
||||
func IsWorkflow(path string) bool {
|
||||
if (!strings.HasSuffix(path, ".yaml")) && (!strings.HasSuffix(path, ".yml")) {
|
||||
return false
|
||||
}
|
||||
|
||||
return strings.HasPrefix(path, ".gitea/workflows") || strings.HasPrefix(path, ".github/workflows")
|
||||
}
|
||||
|
||||
func ListWorkflows(commit *git.Commit) (git.Entries, error) {
|
||||
tree, err := commit.SubTree(".gitea/workflows")
|
||||
if _, ok := err.(git.ErrNotExist); ok {
|
||||
|
Reference in New Issue
Block a user