Skip to content

Commit 3c2bee6

Browse files
committed
Merge branch 'main' into mainzjj
* main: fix(packages): preserve SemVer prerelease identifiers in Swift Registry (go-gitea#39156) [skip ci] Updated translations via Crowdin ci(snap): pack snaps without an LXD container (go-gitea#39152) chore: apply golangci "forbidigo" to all packages (go-gitea#39151) refactor: drop two unmaintained dependencies, rename the byte size helpers (go-gitea#39083) fix(actions): keep step-level continue-on-error expressions unevaluated (go-gitea#39141) [skip ci] Updated translations via Crowdin feat: add deploy tokens (go-gitea#37306) chore: raise minimum git version to 2.25 (go-gitea#39131) fix: recognize linguist language aliases (go-gitea#39135) fix(repo): centralize repository-scoped authorization (go-gitea#39063)
2 parents 6805c4a + d99f020 commit 3c2bee6

183 files changed

Lines changed: 2472 additions & 1792 deletions

File tree

Some content is hidden

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

.github/workflows/release-nightly-snapcraft.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@ jobs:
2525
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
2626
with:
2727
fetch-depth: 0
28-
- uses: snapcore/action-build@3bdaa03e1ba6bf59a65f84a751d943d549a54e79 # v1.3.0
28+
- name: Build snap
2929
id: build
30+
env:
31+
SNAPCRAFT_IMAGE_INFO: '{"build_url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}'
32+
run: |
33+
# snapcraft installs build-snaps and apt packages system-wide, which needs root
34+
sudo snap install --classic snapcraft
35+
sudo SNAPCRAFT_BUILD_INFO=1 SNAPCRAFT_IMAGE_INFO="$SNAPCRAFT_IMAGE_INFO" snapcraft pack --destructive-mode
36+
echo "snap=$(ls ./*.snap)" >> "$GITHUB_OUTPUT"
3037
# retry snapcraft uploads which can be flaky
3138
- name: Publish snap
3239
run: |

.golangci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ linters:
146146
- linters:
147147
- dupl
148148
path: modelmigration/v
149-
- linters:
150-
- forbidigo
151-
path: cmd
152149
- linters:
153150
- dupl
154151
text: (?i)webhook

assets/go-licenses.json

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/actions.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ package cmd
55

66
import (
77
"context"
8-
"fmt"
98

109
"gitea.dev/modules/private"
1110
"gitea.dev/modules/setting"
@@ -49,6 +48,6 @@ func runGenerateActionsRunnerToken(ctx context.Context, c *cli.Command) error {
4948
if extra.HasError() {
5049
return handleCliResponseExtra(extra)
5150
}
52-
_, _ = fmt.Printf("%s\n", respText.Text)
51+
cprintln(c, respText.Text)
5352
return nil
5453
}

cmd/admin_user_change_password.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,6 @@ func runChangePassword(ctx context.Context, c *cli.Command) error {
7373
}
7474
}
7575

76-
fmt.Printf("%s's password has been successfully updated!\n", user.Name)
76+
cprintf(c, "%s's password has been successfully updated!\n", user.Name)
7777
return nil
7878
}

cmd/admin_user_create.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func runCreateUser(ctx context.Context, c *cli.Command) error {
152152
return err
153153
}
154154
// codeql[disable-next-line=go/clear-text-logging]
155-
fmt.Printf("generated random password is '%s'\n", password)
155+
cprintf(c, "generated random password is '%s'\n", password)
156156
} else if userType == user_model.UserTypeIndividual {
157157
return errors.New("must set either password or random-password flag")
158158
}
@@ -228,15 +228,15 @@ func runCreateUser(ctx context.Context, c *cli.Command) error {
228228
if err := user_model.CreateUser(ctx, u, &user_model.Meta{}, overwriteDefault); err != nil {
229229
return fmt.Errorf("CreateUser: %w", err)
230230
}
231-
fmt.Printf("New user '%s' has been successfully created!\n", username)
231+
cprintf(c, "New user '%s' has been successfully created!\n", username)
232232

233233
// create the access token
234234
if accessTokenScope != "" {
235235
t := &auth_model.AccessToken{Name: accessTokenName, UID: u.ID, Scope: accessTokenScope}
236236
if err := auth_model.NewAccessToken(ctx, t); err != nil {
237237
return err
238238
}
239-
fmt.Printf("Access token was successfully created... %s\n", t.Token)
239+
cprintf(c, "Access token was successfully created... %s\n", t.Token)
240240
}
241241
return nil
242242
}

cmd/admin_user_disable_2fa.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ func runDisableTwoFactor(ctx context.Context, c *cli.Command) error {
6767
return err
6868
}
6969

70-
fmt.Printf("Disabled 2FA for user %q (removed %d TOTP and %d WebAuthn credential(s))\n", user.Name, totp, webAuthn)
70+
cprintf(c, "Disabled 2FA for user %q (removed %d TOTP and %d WebAuthn credential(s))\n", user.Name, totp, webAuthn)
7171
return nil
7272
}

cmd/admin_user_generate_access_token.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ func runGenerateAccessToken(ctx context.Context, c *cli.Command) error {
8888
}
8989

9090
if c.Bool("raw") {
91-
fmt.Printf("%s\n", t.Token)
91+
cprintln(c, t.Token)
9292
} else {
93-
fmt.Printf("Access token was successfully created: %s\n", t.Token)
93+
cprintf(c, "Access token was successfully created: %s\n", t.Token)
9494
}
9595

9696
return nil

cmd/admin_user_must_change_password.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package cmd
66
import (
77
"context"
88
"errors"
9-
"fmt"
109

1110
user_model "gitea.dev/models/user"
1211
"gitea.dev/modules/setting"
@@ -59,6 +58,6 @@ func runMustChangePassword(ctx context.Context, c *cli.Command) error {
5958
}
6059

6160
// codeql[disable-next-line=go/clear-text-logging]
62-
fmt.Printf("Updated %d users setting MustChangePassword to %t\n", n, mustChangePassword)
61+
cprintf(c, "Updated %d users setting MustChangePassword to %t\n", n, mustChangePassword)
6362
return nil
6463
}

cmd/doctor.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ func runRecreateTable(ctx context.Context, cmd *cli.Command) error {
114114

115115
setting.Database.LogSQL = debug
116116
if err := db.InitEngine(ctx); err != nil {
117-
fmt.Println(err)
118-
fmt.Println("Check if you are using the right config file. You can use a --config directive to specify one.")
117+
cprintln(cmd, err)
118+
cprintln(cmd, "Check if you are using the right config file. You can use a --config directive to specify one.")
119119
return nil
120120
}
121121

0 commit comments

Comments
 (0)