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:
parent
136d7492ff
commit
6bff6e3a1f
2 changed files with 20 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue