mirror of
https://github.com/go-gitea/gitea.git
synced 2025-09-30 12:45:35 +02:00
add workflow
This commit is contained in:
parent
f2c7d32484
commit
fb12ed211e
30
models/project/workflows.go
Normal file
30
models/project/workflows.go
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
// Copyright 2025 The Gitea Authors. All rights reserved.
|
||||||
|
// SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
package project
|
||||||
|
|
||||||
|
import "code.gitea.io/gitea/models/db"
|
||||||
|
|
||||||
|
type WorkflowEvent string
|
||||||
|
|
||||||
|
const (
|
||||||
|
WorkflowEventItemAddedToProject WorkflowEvent = "item_added_to_project"
|
||||||
|
WorkflowEventItemReopened WorkflowEvent = "item_reopened"
|
||||||
|
WorkflowEventItemClosed WorkflowEvent = "item_closed"
|
||||||
|
WorkflowEventCodeChangesRequested WorkflowEvent = "code_changes_requested"
|
||||||
|
WorkflowEventCodeReviewApproved WorkflowEvent = "code_review_approved"
|
||||||
|
WorkflowEventPullRequestMerged WorkflowEvent = "pull_request_merged"
|
||||||
|
WorkflowEventAutoArchiveItems WorkflowEvent = "auto_archive_items"
|
||||||
|
WorkflowEventAutoAddToProject WorkflowEvent = "auto_add_to_project"
|
||||||
|
WorkflowEventAutoCloseIssue WorkflowEvent = "auto_close_issue"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ProjectWorkflow struct {
|
||||||
|
ID int64
|
||||||
|
ProjectID int64 `xorm:"index"`
|
||||||
|
WorkflowEvent WorkflowEvent `xorm:"index"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
db.RegisterModel(new(ProjectWorkflow))
|
||||||
|
}
|
@ -1383,6 +1383,9 @@ func registerRoutes(m *web.Router) {
|
|||||||
m.Group("/{username}/{reponame}/projects", func() {
|
m.Group("/{username}/{reponame}/projects", func() {
|
||||||
m.Get("", repo.Projects)
|
m.Get("", repo.Projects)
|
||||||
m.Get("/{id}", repo.ViewProject)
|
m.Get("/{id}", repo.ViewProject)
|
||||||
|
m.Group("/{id}/workflows", func() {
|
||||||
|
m.Get("", repo.Workflows)
|
||||||
|
})
|
||||||
m.Group("", func() { //nolint:dupl
|
m.Group("", func() { //nolint:dupl
|
||||||
m.Get("/new", repo.RenderNewProject)
|
m.Get("/new", repo.RenderNewProject)
|
||||||
m.Post("/new", web.Bind(forms.CreateProjectForm{}), repo.NewProjectPost)
|
m.Post("/new", web.Bind(forms.CreateProjectForm{}), repo.NewProjectPost)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user