Skip to content

Commit 8f02684

Browse files
committed
Use appropriate type for RefType
1 parent 95c31fb commit 8f02684

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

routers/api/v1/oidc.go

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"fmt"
99
"net/http"
1010

11+
actions_model "code.gitea.io/gitea/models/actions"
1112
"code.gitea.io/gitea/modules/git"
1213
"code.gitea.io/gitea/modules/setting"
1314
"code.gitea.io/gitea/modules/timeutil"
@@ -30,23 +31,23 @@ type IDTokenErrorResponse struct {
3031
type IDToken struct {
3132
jwt.RegisteredClaims
3233

33-
Ref string `json:"ref,omitempty"`
34-
SHA string `json:"sha,omitempty"`
35-
Repository string `json:"repository,omitempty"`
36-
RepositoryOwner string `json:"repository_owner,omitempty"`
37-
RepositoryOwnerID int `json:"repository_owner_id,omitempty"`
38-
RunID int `json:"run_id,omitempty"`
39-
RunNumber int `json:"run_number,omitempty"`
40-
RunAttempt int `json:"run_attempt,omitempty"`
41-
RepositoryVisibility string `json:"repository_visibility,omitempty"`
42-
RepositoryID int `json:"repository_id,omitempty"`
43-
ActorID int `json:"actor_id,omitempty"`
44-
Actor string `json:"actor,omitempty"`
45-
Workflow string `json:"workflow,omitempty"`
46-
EventName string `json:"event_name,omitempty"`
47-
RefType string `json:"ref_type,omitempty"`
48-
HeadRef string `json:"head_ref,omitempty"`
49-
BaseRef string `json:"base_ref,omitempty"`
34+
Ref string `json:"ref,omitempty"`
35+
SHA string `json:"sha,omitempty"`
36+
Repository string `json:"repository,omitempty"`
37+
RepositoryOwner string `json:"repository_owner,omitempty"`
38+
RepositoryOwnerID int `json:"repository_owner_id,omitempty"`
39+
RunID int `json:"run_id,omitempty"`
40+
RunNumber int `json:"run_number,omitempty"`
41+
RunAttempt int `json:"run_attempt,omitempty"`
42+
RepositoryVisibility string `json:"repository_visibility,omitempty"`
43+
RepositoryID int `json:"repository_id,omitempty"`
44+
ActorID int `json:"actor_id,omitempty"`
45+
Actor string `json:"actor,omitempty"`
46+
Workflow string `json:"workflow,omitempty"`
47+
EventName string `json:"event_name,omitempty"`
48+
RefType git.RefType `json:"ref_type,omitempty"`
49+
HeadRef string `json:"head_ref,omitempty"`
50+
BaseRef string `json:"base_ref,omitempty"`
5051

5152
// Github's OIDC tokens have all of these, but I wasn't sure how
5253
// to populate them. Leaving them here to make future work easier.

0 commit comments

Comments
 (0)