fix fork repo

This commit is contained in:
yp05327 2023-05-26 00:53:45 +00:00
parent facd6982e2
commit af1b031c05

View File

@ -197,15 +197,18 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) {
}
}
// If our branch is the default branch of an unforked repo - there's no PR to create or refer to
if !repo.IsFork && branch == baseRepo.DefaultBranch {
if branch == baseRepo.DefaultBranch {
// TODO: check IsWiki?
err := repo_module.UpdateRepoLicenses(ctx, repo, nil)
if err != nil {
ctx.JSON(http.StatusInternalServerError, private.Response{Err: err.Error()})
}
results = append(results, private.HookPostReceiveBranchResult{})
continue
// If our branch is the default branch of an unforked repo - there's no PR to create or refer to
if !repo.IsFork {
results = append(results, private.HookPostReceiveBranchResult{})
continue
}
}
pr, err := issues_model.GetUnmergedPullRequest(ctx, repo.ID, baseRepo.ID, branch, baseRepo.DefaultBranch, issues_model.PullRequestFlowGithub)