Skip to content

Commit 6042406

Browse files
authored
Add Actor field to WorkflowRun (#2381)
1 parent 0b5813f commit 6042406

4 files changed

Lines changed: 97 additions & 1 deletion

File tree

github/actions_workflow_runs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ type WorkflowRun struct {
4444
WorkflowURL *string `json:"workflow_url,omitempty"`
4545
Repository *Repository `json:"repository,omitempty"`
4646
HeadRepository *Repository `json:"head_repository,omitempty"`
47+
Actor *User `json:"actor,omitempty"`
4748
}
4849

4950
// WorkflowRuns represents a slice of repository action workflow run.

github/actions_workflow_runs_test.go

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,26 @@ func TestWorkflowRun_Marshal(t *testing.T) {
638638
URL: String("u"),
639639
Name: String("n"),
640640
},
641+
Actor: &User{
642+
Login: String("l"),
643+
ID: Int64(1),
644+
AvatarURL: String("a"),
645+
GravatarID: String("g"),
646+
Name: String("n"),
647+
Company: String("c"),
648+
Blog: String("b"),
649+
Location: String("l"),
650+
Email: String("e"),
651+
Hireable: Bool(true),
652+
Bio: String("b"),
653+
TwitterUsername: String("t"),
654+
PublicRepos: Int(1),
655+
Followers: Int(1),
656+
Following: Int(1),
657+
CreatedAt: &Timestamp{referenceTime},
658+
SuspendedAt: &Timestamp{referenceTime},
659+
URL: String("u"),
660+
},
641661
}
642662

643663
want := `{
@@ -718,6 +738,26 @@ func TestWorkflowRun_Marshal(t *testing.T) {
718738
"id": 1,
719739
"url": "u",
720740
"name": "n"
741+
},
742+
"actor": {
743+
"login": "l",
744+
"id": 1,
745+
"avatar_url": "a",
746+
"gravatar_id": "g",
747+
"name": "n",
748+
"company": "c",
749+
"blog": "b",
750+
"location": "l",
751+
"email": "e",
752+
"hireable": true,
753+
"bio": "b",
754+
"twitter_username": "t",
755+
"public_repos": 1,
756+
"followers": 1,
757+
"following": 1,
758+
"created_at": ` + referenceTimeStr + `,
759+
"suspended_at": ` + referenceTimeStr + `,
760+
"url": "u"
721761
}
722762
}`
723763

@@ -809,6 +849,26 @@ func TestWorkflowRuns_Marshal(t *testing.T) {
809849
URL: String("u"),
810850
Name: String("n"),
811851
},
852+
Actor: &User{
853+
Login: String("l"),
854+
ID: Int64(1),
855+
AvatarURL: String("a"),
856+
GravatarID: String("g"),
857+
Name: String("n"),
858+
Company: String("c"),
859+
Blog: String("b"),
860+
Location: String("l"),
861+
Email: String("e"),
862+
Hireable: Bool(true),
863+
Bio: String("b"),
864+
TwitterUsername: String("t"),
865+
PublicRepos: Int(1),
866+
Followers: Int(1),
867+
Following: Int(1),
868+
CreatedAt: &Timestamp{referenceTime},
869+
SuspendedAt: &Timestamp{referenceTime},
870+
URL: String("u"),
871+
},
812872
},
813873
},
814874
}
@@ -894,7 +954,27 @@ func TestWorkflowRuns_Marshal(t *testing.T) {
894954
"id": 1,
895955
"url": "u",
896956
"name": "n"
897-
}
957+
},
958+
"actor": {
959+
"login": "l",
960+
"id": 1,
961+
"avatar_url": "a",
962+
"gravatar_id": "g",
963+
"name": "n",
964+
"company": "c",
965+
"blog": "b",
966+
"location": "l",
967+
"email": "e",
968+
"hireable": true,
969+
"bio": "b",
970+
"twitter_username": "t",
971+
"public_repos": 1,
972+
"followers": 1,
973+
"following": 1,
974+
"created_at": ` + referenceTimeStr + `,
975+
"suspended_at": ` + referenceTimeStr + `,
976+
"url": "u"
977+
}
898978
}
899979
]
900980
}`

github/github-accessors.go

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

github/github-accessors_test.go

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

0 commit comments

Comments
 (0)