Skip to content

Commit 3a1320c

Browse files
authored
Merge branch 'main' into dev/hezi/fix-run-name
2 parents 11e23c2 + cbb2e52 commit 3a1320c

File tree

7 files changed

+40
-10
lines changed

7 files changed

+40
-10
lines changed

modules/structs/repo_tag.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ type Tag struct {
1111
Message string `json:"message"`
1212
ID string `json:"id"`
1313
Commit *CommitMeta `json:"commit"`
14-
ZipballURL string `json:"zipball_url"`
15-
TarballURL string `json:"tarball_url"`
14+
ZipballURL string `json:"zipball_url,omitempty"`
15+
TarballURL string `json:"tarball_url,omitempty"`
1616
}
1717

1818
// AnnotatedTag represents an annotated tag

modules/structs/user_app.go

+7-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ import (
1111
// AccessToken represents an API access token.
1212
// swagger:response AccessToken
1313
type AccessToken struct {
14-
ID int64 `json:"id"`
15-
Name string `json:"name"`
16-
Token string `json:"sha1"`
17-
TokenLastEight string `json:"token_last_eight"`
18-
Scopes []string `json:"scopes"`
14+
ID int64 `json:"id"`
15+
Name string `json:"name"`
16+
Token string `json:"sha1"`
17+
TokenLastEight string `json:"token_last_eight"`
18+
Scopes []string `json:"scopes"`
19+
Created time.Time `json:"created_at"`
20+
Updated time.Time `json:"last_used_at"`
1921
}
2022

2123
// AccessTokenList represents a list of API access token.

modules/structs/user_key.go

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ type PublicKey struct {
1616
Fingerprint string `json:"fingerprint,omitempty"`
1717
// swagger:strfmt date-time
1818
Created time.Time `json:"created_at,omitempty"`
19+
Updated time.Time `json:"last_used_at,omitempty"`
1920
Owner *User `json:"user,omitempty"`
2021
ReadOnly bool `json:"read_only,omitempty"`
2122
KeyType string `json:"key_type,omitempty"`

routers/api/v1/user/app.go

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ func ListAccessTokens(ctx *context.APIContext) {
6262
Name: tokens[i].Name,
6363
TokenLastEight: tokens[i].TokenLastEight,
6464
Scopes: tokens[i].Scope.StringSlice(),
65+
Created: tokens[i].CreatedUnix.AsTime(),
66+
Updated: tokens[i].UpdatedUnix.AsTime(),
6567
}
6668
}
6769

services/convert/convert.go

+12-2
Original file line numberDiff line numberDiff line change
@@ -197,13 +197,22 @@ func ToBranchProtection(ctx context.Context, bp *git_model.ProtectedBranch, repo
197197

198198
// ToTag convert a git.Tag to an api.Tag
199199
func ToTag(repo *repo_model.Repository, t *git.Tag) *api.Tag {
200+
tarballURL := util.URLJoin(repo.HTMLURL(), "archive", t.Name+".tar.gz")
201+
zipballURL := util.URLJoin(repo.HTMLURL(), "archive", t.Name+".zip")
202+
203+
// Archive URLs are "" if the download feature is disabled
204+
if setting.Repository.DisableDownloadSourceArchives {
205+
tarballURL = ""
206+
zipballURL = ""
207+
}
208+
200209
return &api.Tag{
201210
Name: t.Name,
202211
Message: strings.TrimSpace(t.Message),
203212
ID: t.ID.String(),
204213
Commit: ToCommitMeta(repo, t),
205-
ZipballURL: util.URLJoin(repo.HTMLURL(), "archive", t.Name+".zip"),
206-
TarballURL: util.URLJoin(repo.HTMLURL(), "archive", t.Name+".tar.gz"),
214+
ZipballURL: zipballURL,
215+
TarballURL: tarballURL,
207216
}
208217
}
209218

@@ -307,6 +316,7 @@ func ToPublicKey(apiLink string, key *asymkey_model.PublicKey) *api.PublicKey {
307316
Title: key.Name,
308317
Fingerprint: key.Fingerprint,
309318
Created: key.CreatedUnix.AsTime(),
319+
Updated: key.UpdatedUnix.AsTime(),
310320
}
311321
}
312322

templates/shared/repo_search.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="ui small secondary filter menu">
2-
<form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-gap-x-2">
2+
<form id="repo-search-form" class="ui form ignore-dirty tw-flex-1 tw-flex tw-items-center tw-gap-x-2">
33
{{if .Language}}<input type="hidden" name="language" value="{{.Language}}">{{end}}
44
{{if .PageIsExploreRepositories}}<input type="hidden" name="only_show_relevant" value="{{.OnlyShowRelevant}}">{{end}}
55
{{if .TabName}}<input type="hidden" name="tab" value="{{.TabName}}">{{end}}

templates/swagger/v1_json.tmpl

+15
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)