Skip to content

Commit fe1be72

Browse files
authored
Merge branch 'go-gitea:main' into patch-1
2 parents c919c01 + ffb2765 commit fe1be72

File tree

171 files changed

+1988
-1773
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

171 files changed

+1988
-1773
lines changed

.eslintrc.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ module.exports = {
336336
'@typescript-eslint/no-unsafe-unary-minus': [2],
337337
'@typescript-eslint/no-unused-expressions': [0],
338338
'@typescript-eslint/no-unused-vars': [2, {vars: 'all', args: 'all', caughtErrors: 'all', ignoreRestSiblings: false, argsIgnorePattern: '^_', varsIgnorePattern: '^_', caughtErrorsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_'}],
339-
'@typescript-eslint/no-use-before-define': [0],
339+
'@typescript-eslint/no-use-before-define': [2, {functions: false, classes: true, variables: true, allowNamedExports: true, typedefs: false, enums: false, ignoreTypeReferences: true}],
340340
'@typescript-eslint/no-useless-constructor': [0],
341341
'@typescript-eslint/no-useless-empty-export': [0],
342342
'@typescript-eslint/no-wrapper-object-types': [2],
@@ -693,7 +693,7 @@ module.exports = {
693693
'no-unused-labels': [2],
694694
'no-unused-private-class-members': [2],
695695
'no-unused-vars': [0], // handled by @typescript-eslint/no-unused-vars
696-
'no-use-before-define': [2, {functions: false, classes: true, variables: true, allowNamedExports: true}],
696+
'no-use-before-define': [0], // handled by @typescript-eslint/no-use-before-define
697697
'no-use-extend-native/no-use-extend-native': [2],
698698
'no-useless-backreference': [2],
699699
'no-useless-call': [2],

.github/labeler.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ modifies/internal:
4141
- ".dockerignore"
4242
- "docker/**"
4343
- ".editorconfig"
44-
- ".eslintrc.yaml"
44+
- ".eslintrc.cjs"
4545
- ".golangci.yml"
4646
- ".gitpod.yml"
4747
- ".markdownlint.yaml"
4848
- ".spectral.yaml"
4949
- "stylelint.config.js"
5050
- ".yamllint.yaml"
5151
- ".github/**"
52-
- ".gitea/"
52+
- ".gitea/**"
5353
- ".devcontainer/**"
5454
- "build.go"
5555
- "build/**"
@@ -73,9 +73,9 @@ modifies/go:
7373
modifies/frontend:
7474
- changed-files:
7575
- any-glob-to-any-file:
76-
- "**/*.js"
77-
- "**/*.ts"
78-
- "**/*.vue"
76+
- "*.js"
77+
- "*.ts"
78+
- "web_src/**"
7979

8080
docs-update-needed:
8181
- changed-files:

.github/workflows/files-changed.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,16 @@ jobs:
5151
- "options/locale/locale_en-US.ini"
5252
5353
frontend:
54-
- "**/*.js"
54+
- "*.js"
55+
- "*.ts"
5556
- "web_src/**"
57+
- "tools/*.js"
58+
- "tools/*.ts"
5659
- "assets/emoji.json"
5760
- "package.json"
5861
- "package-lock.json"
5962
- "Makefile"
60-
- ".eslintrc.yaml"
61-
- "stylelint.config.js"
63+
- ".eslintrc.cjs"
6264
- ".npmrc"
6365
6466
docs:

.github/workflows/pull-compliance.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595
go-version-file: go.mod
9696
check-latest: true
9797
- run: make deps-backend deps-tools
98-
- run: make lint-go-windows lint-go-vet
98+
- run: make lint-go-windows lint-go-gitea-vet
9999
env:
100100
TAGS: bindata sqlite sqlite_unlock_notify
101101
GOOS: windows

Makefile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ EXTRA_GOFLAGS ?=
7373
MAKE_VERSION := $(shell "$(MAKE)" -v | cat | head -n 1)
7474
MAKE_EVIDENCE_DIR := .make_evidence
7575

76+
GOTESTFLAGS ?= -vet=off
7677
ifeq ($(RACE_ENABLED),true)
7778
GOFLAGS += -race
7879
GOTESTFLAGS += -race
@@ -311,10 +312,10 @@ lint-frontend: lint-js lint-css ## lint frontend files
311312
lint-frontend-fix: lint-js-fix lint-css-fix ## lint frontend files and fix issues
312313

313314
.PHONY: lint-backend
314-
lint-backend: lint-go lint-go-vet lint-go-gopls lint-editorconfig ## lint backend files
315+
lint-backend: lint-go lint-go-gitea-vet lint-go-gopls lint-editorconfig ## lint backend files
315316

316317
.PHONY: lint-backend-fix
317-
lint-backend-fix: lint-go-fix lint-go-vet lint-editorconfig ## lint backend files and fix issues
318+
lint-backend-fix: lint-go-fix lint-go-gitea-vet lint-editorconfig ## lint backend files and fix issues
318319

319320
.PHONY: lint-js
320321
lint-js: node_modules ## lint js files
@@ -365,9 +366,9 @@ lint-go-windows:
365366
@GOOS= GOARCH= $(GO) install $(GOLANGCI_LINT_PACKAGE)
366367
golangci-lint run
367368

368-
.PHONY: lint-go-vet
369-
lint-go-vet: ## lint go files with vet
370-
@echo "Running go vet..."
369+
.PHONY: lint-go-gitea-vet
370+
lint-go-gitea-vet: ## lint go files with gitea-vet
371+
@echo "Running gitea-vet..."
371372
@GOOS= GOARCH= $(GO) build code.gitea.io/gitea-vet
372373
@$(GO) vet -vettool=gitea-vet ./...
373374

@@ -470,7 +471,9 @@ tidy-check: tidy
470471
go-licenses: $(GO_LICENSE_FILE) ## regenerate go licenses
471472

472473
$(GO_LICENSE_FILE): go.mod go.sum
473-
-$(GO) run $(GO_LICENSES_PACKAGE) save . --force --save_path=$(GO_LICENSE_TMP_DIR) 2>/dev/null
474+
@rm -rf $(GO_LICENSE_FILE)
475+
$(GO) install $(GO_LICENSES_PACKAGE)
476+
-GOOS=linux CGO_ENABLED=1 go-licenses save . --force --save_path=$(GO_LICENSE_TMP_DIR) 2>/dev/null
474477
$(GO) run build/generate-go-licenses.go $(GO_LICENSE_TMP_DIR) $(GO_LICENSE_FILE)
475478
@rm -rf $(GO_LICENSE_TMP_DIR)
476479

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ go 1.24
88
godebug x509negativeserial=1
99

1010
require (
11-
code.gitea.io/actions-proto-go v0.4.0
11+
code.gitea.io/actions-proto-go v0.4.1
1212
code.gitea.io/gitea-vet v0.2.3
1313
code.gitea.io/sdk/gitea v0.20.0
1414
codeberg.org/gusted/mcaptcha v0.0.0-20220723083913-4f3072e1d570
@@ -24,7 +24,7 @@ require (
2424
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.17.0
2525
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.6.0
2626
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358
27-
github.com/ProtonMail/go-crypto v1.1.5
27+
github.com/ProtonMail/go-crypto v1.1.6
2828
github.com/PuerkitoBio/goquery v1.10.2
2929
github.com/SaveTheRbtz/zstd-seekable-format-go/pkg v0.7.3
3030
github.com/alecthomas/chroma/v2 v2.15.0
@@ -318,7 +318,7 @@ replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1
318318

319319
replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142115-2c99e1ffdfa0
320320

321-
replace github.com/nektos/act => gitea.com/gitea/act v0.261.3
321+
replace github.com/nektos/act => gitea.com/gitea/act v0.261.4
322322

323323
// TODO: the only difference is in `PutObject`: the fork doesn't use `NewVerifyingReader(r, sha256.New(), oid, expectedSize)`, need to figure out why
324324
replace github.com/charmbracelet/git-lfs-transfer => gitea.com/gitea/git-lfs-transfer v0.2.0

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cloud.google.com/go/compute/metadata v0.6.0 h1:A6hENjEsCDtC1k8byVsgwvVcioamEHvZ4j01OwKxG9I=
22
cloud.google.com/go/compute/metadata v0.6.0/go.mod h1:FjyFAW1MW0C203CEOMDTu3Dk1FlqW3Rga40jzHL4hfg=
3-
code.gitea.io/actions-proto-go v0.4.0 h1:OsPBPhodXuQnsspG1sQ4eRE1PeoZyofd7+i73zCwnsU=
4-
code.gitea.io/actions-proto-go v0.4.0/go.mod h1:mn7Wkqz6JbnTOHQpot3yDeHx+O5C9EGhMEE+htvHBas=
3+
code.gitea.io/actions-proto-go v0.4.1 h1:l0EYhjsgpUe/1VABo2eK7zcoNX2W44WOnb0MSLrKfls=
4+
code.gitea.io/actions-proto-go v0.4.1/go.mod h1:mn7Wkqz6JbnTOHQpot3yDeHx+O5C9EGhMEE+htvHBas=
55
code.gitea.io/gitea-vet v0.2.3 h1:gdFmm6WOTM65rE8FUBTRzeQZYzXePKSSB1+r574hWwI=
66
code.gitea.io/gitea-vet v0.2.3/go.mod h1:zcNbT/aJEmivCAhfmkHOlT645KNOf9W2KnkLgFjGGfE=
77
code.gitea.io/sdk/gitea v0.20.0 h1:Zm/QDwwZK1awoM4AxdjeAQbxolzx2rIP8dDfmKu+KoU=
@@ -16,8 +16,8 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
1616
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
1717
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078 h1:cliQ4HHsCo6xi2oWZYKWW4bly/Ory9FuTpFPRxj/mAg=
1818
git.sr.ht/~mariusor/go-xsd-duration v0.0.0-20220703122237-02e73435a078/go.mod h1:g/V2Hjas6Z1UHUp4yIx6bATpNzJ7DYtD0FG3+xARWxs=
19-
gitea.com/gitea/act v0.261.3 h1:BhiYpGJQKGq0XMYYICCYAN4KnsEWHyLbA6dxhZwFcV4=
20-
gitea.com/gitea/act v0.261.3/go.mod h1:Pg5C9kQY1CEA3QjthjhlrqOC/QOT5NyWNjOjRHw23Ok=
19+
gitea.com/gitea/act v0.261.4 h1:Tf9eLlvsYFtKcpuxlMvf9yT3g4Hshb2Beqw6C1STuH8=
20+
gitea.com/gitea/act v0.261.4/go.mod h1:Pg5C9kQY1CEA3QjthjhlrqOC/QOT5NyWNjOjRHw23Ok=
2121
gitea.com/gitea/git-lfs-transfer v0.2.0 h1:baHaNoBSRaeq/xKayEXwiDQtlIjps4Ac/Ll4KqLMB40=
2222
gitea.com/gitea/git-lfs-transfer v0.2.0/go.mod h1:UrXUCm3xLQkq15fu7qlXHUMlrhdlXHoi13KH2Dfiits=
2323
gitea.com/go-chi/binding v0.0.0-20240430071103-39a851e106ed h1:EZZBtilMLSZNWtHHcgq2mt6NSGhJSZBuduAlinMEmso=
@@ -71,8 +71,8 @@ github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSC
7171
github.com/Microsoft/go-winio v0.5.2/go.mod h1:WpS1mjBmmwHBEWmogvA2mj8546UReBk4v8QkMxJ6pZY=
7272
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
7373
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
74-
github.com/ProtonMail/go-crypto v1.1.5 h1:eoAQfK2dwL+tFSFpr7TbOaPNUbPiJj4fLYwwGE1FQO4=
75-
github.com/ProtonMail/go-crypto v1.1.5/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE=
74+
github.com/ProtonMail/go-crypto v1.1.6 h1:ZcV+Ropw6Qn0AX9brlQLAUXfqLBc7Bl+f/DmNxpLfdw=
75+
github.com/ProtonMail/go-crypto v1.1.6/go.mod h1:rA3QumHc/FZ8pAHreoekgiAbzpNsfQAosU5td4SnOrE=
7676
github.com/PuerkitoBio/goquery v1.10.2 h1:7fh2BdHcG6VFZsK7toXBT/Bh1z5Wmy8Q9MV9HqT2AM8=
7777
github.com/PuerkitoBio/goquery v1.10.2/go.mod h1:0guWGjcLu9AYC7C1GHnpysHy056u9aEkUHwhdnePMCU=
7878
github.com/RoaringBitmap/roaring v0.4.23/go.mod h1:D0gp8kJQgE1A4LQ5wFLggQEyvDi06Mq5mKs52e1TwOo=

models/actions/runner.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,3 +337,17 @@ func FixRunnersWithoutBelongingRepo(ctx context.Context) (int64, error) {
337337
}
338338
return res.RowsAffected()
339339
}
340+
341+
func CountWrongRepoLevelRunners(ctx context.Context) (int64, error) {
342+
var result int64
343+
_, err := db.GetEngine(ctx).SQL("SELECT count(`id`) FROM `action_runner` WHERE `repo_id` > 0 AND `owner_id` > 0").Get(&result)
344+
return result, err
345+
}
346+
347+
func UpdateWrongRepoLevelRunners(ctx context.Context) (int64, error) {
348+
result, err := db.GetEngine(ctx).Exec("UPDATE `action_runner` SET `owner_id` = 0 WHERE `repo_id` > 0 AND `owner_id` > 0")
349+
if err != nil {
350+
return 0, err
351+
}
352+
return result.RowsAffected()
353+
}

models/actions/variable.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,17 @@ func GetVariablesOfRun(ctx context.Context, run *ActionRun) (map[string]string,
147147

148148
return variables, nil
149149
}
150+
151+
func CountWrongRepoLevelVariables(ctx context.Context) (int64, error) {
152+
var result int64
153+
_, err := db.GetEngine(ctx).SQL("SELECT count(`id`) FROM `action_variable` WHERE `repo_id` > 0 AND `owner_id` > 0").Get(&result)
154+
return result, err
155+
}
156+
157+
func UpdateWrongRepoLevelVariables(ctx context.Context) (int64, error) {
158+
result, err := db.GetEngine(ctx).Exec("UPDATE `action_variable` SET `owner_id` = 0 WHERE `repo_id` > 0 AND `owner_id` > 0")
159+
if err != nil {
160+
return 0, err
161+
}
162+
return result.RowsAffected()
163+
}

models/asymkey/error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func (err ErrKeyUnableVerify) Error() string {
2525
}
2626

2727
// ErrKeyIsPrivate is returned when the provided key is a private key not a public key
28-
var ErrKeyIsPrivate = util.NewSilentWrapErrorf(util.ErrInvalidArgument, "the provided key is a private key")
28+
var ErrKeyIsPrivate = util.ErrorWrap(util.ErrInvalidArgument, "the provided key is a private key")
2929

3030
// ErrKeyNotExist represents a "KeyNotExist" kind of error.
3131
type ErrKeyNotExist struct {

0 commit comments

Comments
 (0)