mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 03:25:11 +01:00 
			
		
		
		
	Add workflow
This commit is contained in:
		
							parent
							
								
									f75a4abc5d
								
							
						
					
					
						commit
						243c1e5134
					
				| @ -11,8 +11,20 @@ import ( | ||||
| ) | ||||
| 
 | ||||
| func BuildView(ctx *context.Context) { | ||||
| 	ctx.Data["RunID"] = ctx.Params("runid") | ||||
| 	ctx.Data["JobID"] = ctx.Params("jobid") | ||||
| 	runID := ctx.ParamsInt64("runid") | ||||
| 	ctx.Data["RunID"] = runID | ||||
| 	jobID := ctx.ParamsInt64("jobid") | ||||
| 	if jobID <= 0 { | ||||
| 		runJobs, err := bots_model.GetRunJobsByRunID(ctx, runID) | ||||
| 		if err != nil { | ||||
| 			return | ||||
| 		} | ||||
| 		if len(runJobs) <= 0 { | ||||
| 			return | ||||
| 		} | ||||
| 		jobID = runJobs[0].ID | ||||
| 	} | ||||
| 	ctx.Data["JobID"] = jobID | ||||
| 
 | ||||
| 	ctx.HTML(http.StatusOK, "dev/buildview") | ||||
| } | ||||
|  | ||||
| @ -11,6 +11,7 @@ import ( | ||||
| 	"code.gitea.io/gitea/models/db" | ||||
| 	"code.gitea.io/gitea/models/unit" | ||||
| 	"code.gitea.io/gitea/modules/base" | ||||
| 	"code.gitea.io/gitea/modules/bots" | ||||
| 	"code.gitea.io/gitea/modules/context" | ||||
| 	"code.gitea.io/gitea/modules/convert" | ||||
| 	"code.gitea.io/gitea/modules/util" | ||||
| @ -40,6 +41,25 @@ func List(ctx *context.Context) { | ||||
| 	ctx.Data["Title"] = ctx.Tr("repo.builds") | ||||
| 	ctx.Data["PageIsBuildList"] = true | ||||
| 
 | ||||
| 	defaultBranch, err := ctx.Repo.GitRepo.GetDefaultBranch() | ||||
| 	if err != nil { | ||||
| 		ctx.Error(http.StatusInternalServerError, err.Error()) | ||||
| 		return | ||||
| 	} | ||||
| 	commit, err := ctx.Repo.GitRepo.GetBranchCommit(defaultBranch) | ||||
| 	if err != nil { | ||||
| 		ctx.Error(http.StatusInternalServerError, err.Error()) | ||||
| 		return | ||||
| 	} | ||||
| 
 | ||||
| 	workflows, err := bots.ListWorkflows(commit) | ||||
| 	if err != nil { | ||||
| 		ctx.Error(http.StatusInternalServerError, err.Error()) | ||||
| 		return | ||||
| 	} | ||||
| 
 | ||||
| 	ctx.Data["workflows"] = workflows | ||||
| 
 | ||||
| 	page := ctx.FormInt("page") | ||||
| 	if page <= 0 { | ||||
| 		page = 1 | ||||
|  | ||||
| @ -1,6 +1,11 @@ | ||||
| {{template "base/head" .}} | ||||
| <div class="page-content repository"> | ||||
| 	{{template "repo/header" .}} | ||||
| 	<div> | ||||
| 	{{range .workflows}} | ||||
| 	<li>{{.Name}}</li> | ||||
| 	{{end}} | ||||
| 	</div> | ||||
| 	<div class="ui container"> | ||||
| 		<div id="issue-filters" class="ui stackable grid"> | ||||
| 			<div class="six wide column"> | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user