@@ -2,6 +2,7 @@ package github
2
2
3
3
import (
4
4
"context"
5
+ "encoding/json"
5
6
"io"
6
7
"strings"
7
8
"time"
@@ -33,6 +34,13 @@ type auditLogEntryContents struct {
33
34
}
34
35
ActorLogin string
35
36
ActorIp string
37
+ ActorLocation struct {
38
+ City string `json:"city"`
39
+ Country string `json:"country"`
40
+ CountryCode string `json:"countryCode"`
41
+ Region string `json:"region"`
42
+ RegionCode string `json:"regionCode"`
43
+ }
36
44
CreatedAt githubv4.DateTime
37
45
OperationType string
38
46
UserLogin string
@@ -107,6 +115,12 @@ func (i *iterOrgAuditLogs) Column(ctx vtab.Context, c int) error {
107
115
ctx .ResultText (current .Entry .ActorLogin )
108
116
case "actor_ip" :
109
117
ctx .ResultText (current .Entry .ActorIp )
118
+ case "actor_location" :
119
+ if s , err := json .Marshal (current .Entry .ActorLocation ); err != nil {
120
+ return err
121
+ } else {
122
+ ctx .ResultText (string (s ))
123
+ }
110
124
case "created_at" :
111
125
t := current .Entry .CreatedAt
112
126
if t .IsZero () {
@@ -163,6 +177,7 @@ var orgAuditCols = []vtab.Column{
163
177
{Name : "actor_type" , Type : "TEXT" },
164
178
{Name : "actor_login" , Type : "TEXT" },
165
179
{Name : "actor_ip" , Type : "TEXT" },
180
+ {Name : "actor_location" , Type : "JSON" },
166
181
{Name : "created_at" , Type : "DATETIME" , OrderBy : vtab .ASC | vtab .DESC },
167
182
{Name : "operation_type" , Type : "TEXT" },
168
183
{Name : "user_login" , Type : "TEXT" },
0 commit comments