Skip to content

Commit

Permalink
Add OldLogin field to AuditEntryData (#2850)
Browse files Browse the repository at this point in the history
Relates to: #2843.
  • Loading branch information
lmartinking committed Jul 28, 2023
1 parent 44d09ce commit f897b2c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
8 changes: 8 additions & 0 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion github/orgs_audit_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ type AuditEntry struct {

// AuditEntryData represents additional information stuffed into a `data` field.
type AuditEntryData struct {
OldName *string `json:"old_name,omitempty"` // The previous name of the repository, for a name change
OldName *string `json:"old_name,omitempty"` // The previous name of the repository, for a name change
OldLogin *string `json:"old_login,omitempty"` // The previous name of the organization, for a name change
}

// GetAuditLog gets the audit-log entries for an organization.
Expand Down
6 changes: 4 additions & 2 deletions github/orgs_audit_log_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ func TestAuditEntry_Marshal(t *testing.T) {
WorkflowID: Int64(1),
WorkflowRunID: Int64(1),
Data: &AuditEntryData{
OldName: String("on"),
OldName: String("on"),
OldLogin: String("ol"),
},
}

Expand Down Expand Up @@ -396,7 +397,8 @@ func TestAuditEntry_Marshal(t *testing.T) {
"workflow_id": 1,
"workflow_run_id": 1,
"data": {
"old_name": "on"
"old_name": "on",
"old_login": "ol"
}
}`

Expand Down

0 comments on commit f897b2c

Please sign in to comment.