From cc8874864ca44ec013e132ebcb80b40878010d12 Mon Sep 17 00:00:00 2001 From: Zettat123 Date: Mon, 24 Apr 2023 12:46:54 +0800 Subject: [PATCH 1/5] Upgrade act (#24298) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9f0a23f4550f..a71b136cb1f2 100644 --- a/go.mod +++ b/go.mod @@ -291,7 +291,7 @@ replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142 replace github.com/blevesearch/zapx/v15 v15.3.6 => github.com/zeripath/zapx/v15 v15.3.6-alignment-fix -replace github.com/nektos/act => gitea.com/gitea/act v0.243.3-0.20230407083103-5c4a96bcb797 +replace github.com/nektos/act => gitea.com/gitea/act v0.243.4 exclude github.com/gofrs/uuid v3.2.0+incompatible diff --git a/go.sum b/go.sum index e48fa8b45b80..2a3cc5967e54 100644 --- a/go.sum +++ b/go.sum @@ -52,8 +52,8 @@ codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570/go.mod h1:IIAjsi dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 h1:cliQ4HHsCo6xi2oWZYKWW4bly/Ory9FuTpFPRxj/mAg= git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078/go.mod h1:g/V2Hjas6Z1UHUp4yIx6bATpNzJ7DYtD0FG3+xARWxs= -gitea.com/gitea/act v0.243.3-0.20230407083103-5c4a96bcb797 h1:QdQ+pHxpbIi2qsgZbYVxqYV7trfW3P5M/T4AfpoM7iw= -gitea.com/gitea/act v0.243.3-0.20230407083103-5c4a96bcb797/go.mod h1:mabw6AZAiDgxGlK83orWLrNERSPvgBJzEUS3S7u2bHI= +gitea.com/gitea/act v0.243.4 h1:MuBHBLCJfpa6mzwwvs4xqQynrSP2RRzpHpWfTV16PmI= +gitea.com/gitea/act v0.243.4/go.mod h1:mabw6AZAiDgxGlK83orWLrNERSPvgBJzEUS3S7u2bHI= gitea.com/go-chi/binding v0.0.0-20221013104517-b29891619681 h1:MMSPgnVULVwV9kEBgvyEUhC9v/uviZ55hPJEMjpbNR4= gitea.com/go-chi/binding v0.0.0-20221013104517-b29891619681/go.mod h1:77TZu701zMXWJFvB8gvTbQ92zQ3DQq/H7l5wAEjQRKc= gitea.com/go-chi/cache v0.0.0-20210110083709-82c4c9ce2d5e/go.mod h1:k2V/gPDEtXGjjMGuBJiapffAXTv76H4snSmlJRLUhH0= From a319da0688763df662f5ef71684c8e9101803dbb Mon Sep 17 00:00:00 2001 From: silverwind Date: Mon, 24 Apr 2023 08:48:43 +0200 Subject: [PATCH 2/5] Replace whitespace inside template parens during make fmt (#24293) Remove space/tab after `(` and before `)` in templates. Only two violations it seems. --- Makefile | 8 ++++++-- templates/repo/issue/labels/label_list.tmpl | 2 +- templates/repo/settings/collaboration.tmpl | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index c94f36d6a92f..9291c4486572 100644 --- a/Makefile +++ b/Makefile @@ -278,8 +278,12 @@ clean: fmt: GOFUMPT_PACKAGE=$(GOFUMPT_PACKAGE) $(GO) run build/code-batch-process.go gitea-fmt -w '{file-list}' $(eval TEMPLATES := $(shell find templates -type f -name '*.tmpl')) - @# strip whitespace after '{{' and before `}}` unless there is only whitespace before it - @$(SED_INPLACE) -e 's/{{[ ]\{1,\}/{{/g' -e '/^[ ]\{1,\}}}/! s/[ ]\{1,\}}}/}}/g' $(TEMPLATES) + @# strip whitespace after '{{' or '(' and before '}}' or ')' unless there is only + @# whitespace before it + @$(SED_INPLACE) \ + -e 's/{{[ ]\{1,\}/{{/g' -e '/^[ ]\{1,\}}}/! s/[ ]\{1,\}}}/}}/g' \ + -e 's/([ ]\{1,\}/(/g' -e '/^[ ]\{1,\})/! s/[ ]\{1,\})/)/g' \ + $(TEMPLATES) .PHONY: fmt-check fmt-check: fmt diff --git a/templates/repo/issue/labels/label_list.tmpl b/templates/repo/issue/labels/label_list.tmpl index a188a2f5d25c..d2c041e2ca11 100644 --- a/templates/repo/issue/labels/label_list.tmpl +++ b/templates/repo/issue/labels/label_list.tmpl @@ -42,7 +42,7 @@ {{end}}
- {{if and (not $.PageIsOrgSettingsLabels ) (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}} + {{if and (not $.PageIsOrgSettingsLabels) (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}} {{svg "octicon-trash"}} {{$.locale.Tr "repo.issues.label_delete"}} {{svg "octicon-pencil"}} {{$.locale.Tr "repo.issues.label_edit"}} {{else if $.PageIsOrgSettingsLabels}} diff --git a/templates/repo/settings/collaboration.tmpl b/templates/repo/settings/collaboration.tmpl index 6b1fcf194afc..82696612f894 100644 --- a/templates/repo/settings/collaboration.tmpl +++ b/templates/repo/settings/collaboration.tmpl @@ -52,7 +52,7 @@

{{$.locale.Tr "repo.settings.teams"}}

- {{$allowedToChangeTeams := ( or (.Org.RepoAdminChangeTeamAccess) (.Permission.IsOwner))}} + {{$allowedToChangeTeams := (or (.Org.RepoAdminChangeTeamAccess) (.Permission.IsOwner))}} {{if .Teams}}
{{range $t, $team := .Teams}} From 9c33cbd3441fc866c3056d53b62c5420588a538a Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Mon, 24 Apr 2023 17:51:44 +0900 Subject: [PATCH 3/5] Fix no edit/close/delete button in org repo project view page (#24301) Part of #23318. --- templates/repo/projects/view.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/projects/view.tmpl b/templates/repo/projects/view.tmpl index cff78df70bfe..df880591b746 100644 --- a/templates/repo/projects/view.tmpl +++ b/templates/repo/projects/view.tmpl @@ -47,7 +47,7 @@

{{$.Project.Title}}

{{$.Project.RenderedContent|Str2html}}
- {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}} + {{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
-{{if or .CanWriteIssues .CanWritePulls}} +{{if .CanWriteProjects}} -