diff --git a/models/actions/run_job.go b/models/actions/run_job.go index d12748d554..93097cc449 100644 --- a/models/actions/run_job.go +++ b/models/actions/run_job.go @@ -20,7 +20,6 @@ import ( // MaxJobNumPerRun is the maximum number of jobs in a single run. // https://docs.github.com/en/actions/reference/limits#existing-system-limits -// TODO: check this limit when creating jobs const MaxJobNumPerRun = 256 // ActionRunJob represents a job of a run diff --git a/routers/web/web.go b/routers/web/web.go index 342c851f58..34164528f9 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -595,7 +595,6 @@ func registerWebRoutes(m *web.Router, webAuth *AuthMiddleware) { m.Group("", func() { m.Get("/authorize", web.Bind(forms.AuthorizationForm{}), auth.AuthorizeOAuth) m.Post("/grant", web.Bind(forms.GrantApplicationForm{}), auth.GrantApplicationOAuth) - // TODO manage redirection m.Post("/authorize", web.Bind(forms.AuthorizationForm{}), auth.AuthorizeOAuth) }, reqSignIn) diff --git a/services/actions/run.go b/services/actions/run.go index 82c9b17aec..6151ca3905 100644 --- a/services/actions/run.go +++ b/services/actions/run.go @@ -82,6 +82,10 @@ func InsertRun(ctx context.Context, run *actions_model.ActionRun, content []byte return fmt.Errorf("parse workflow: %w", err) } + if len(jobs) > actions_model.MaxJobNumPerRun { + return fmt.Errorf("workflow has too many jobs (%d), maximum is %d", len(jobs), actions_model.MaxJobNumPerRun) + } + titleChanged := len(jobs) > 0 && jobs[0].RunName != "" if titleChanged { run.Title = util.EllipsisDisplayString(jobs[0].RunName, 255) diff --git a/web_src/js/utils.ts b/web_src/js/utils.ts index feeb4d3b6b..45a39ef85e 100644 --- a/web_src/js/utils.ts +++ b/web_src/js/utils.ts @@ -52,9 +52,11 @@ export function stripTags(text: string): string { } export function parseIssueHref(href: string): IssuePathInfo { - // FIXME: it should use pathname and trim the appSubUrl ahead - const path = (href || '').replace(/[#?].*$/, ''); - const [_, ownerName, repoName, pathType, indexString] = /([^/]+)\/([^/]+)\/(issues|pulls)\/([0-9]+)/.exec(path) || []; + let pathname = href || ''; + try { pathname = new URL(pathname, window.location.origin).pathname } catch {} + const appSubUrl = window.config.appSubUrl; + if (appSubUrl && pathname.startsWith(appSubUrl)) pathname = pathname.substring(appSubUrl.length); + const [_, ownerName, repoName, pathType, indexString] = /([^/]+)\/([^/]+)\/(issues|pulls)\/([0-9]+)/.exec(pathname) || []; return {ownerName, repoName, pathType, indexString}; }