@@ -41,31 +41,31 @@ func Test_ListWorkflows(t *testing.T) {
4141 mock .GetReposActionsWorkflowsByOwnerByRepo ,
4242 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
4343 workflows := & github.Workflows {
44- TotalCount : github .Int (2 ),
44+ TotalCount : github .Ptr (2 ),
4545 Workflows : []* github.Workflow {
4646 {
47- ID : github .Int64 ( 123 ),
48- Name : github .String ("CI" ),
49- Path : github .String (".github/workflows/ci.yml" ),
50- State : github .String ("active" ),
47+ ID : github .Ptr ( int64 ( 123 ) ),
48+ Name : github .Ptr ("CI" ),
49+ Path : github .Ptr (".github/workflows/ci.yml" ),
50+ State : github .Ptr ("active" ),
5151 CreatedAt : & github.Timestamp {},
5252 UpdatedAt : & github.Timestamp {},
53- URL : github .String ("https://api.github.com/repos/owner/repo/actions/workflows/123" ),
54- HTMLURL : github .String ("https://github.com/owner/repo/actions/workflows/ci.yml" ),
55- BadgeURL : github .String ("https://github.com/owner/repo/workflows/CI/badge.svg" ),
56- NodeID : github .String ("W_123" ),
53+ URL : github .Ptr ("https://api.github.com/repos/owner/repo/actions/workflows/123" ),
54+ HTMLURL : github .Ptr ("https://github.com/owner/repo/actions/workflows/ci.yml" ),
55+ BadgeURL : github .Ptr ("https://github.com/owner/repo/workflows/CI/badge.svg" ),
56+ NodeID : github .Ptr ("W_123" ),
5757 },
5858 {
59- ID : github .Int64 ( 456 ),
60- Name : github .String ("Deploy" ),
61- Path : github .String (".github/workflows/deploy.yml" ),
62- State : github .String ("active" ),
59+ ID : github .Ptr ( int64 ( 456 ) ),
60+ Name : github .Ptr ("Deploy" ),
61+ Path : github .Ptr (".github/workflows/deploy.yml" ),
62+ State : github .Ptr ("active" ),
6363 CreatedAt : & github.Timestamp {},
6464 UpdatedAt : & github.Timestamp {},
65- URL : github .String ("https://api.github.com/repos/owner/repo/actions/workflows/456" ),
66- HTMLURL : github .String ("https://github.com/owner/repo/actions/workflows/deploy.yml" ),
67- BadgeURL : github .String ("https://github.com/owner/repo/workflows/Deploy/badge.svg" ),
68- NodeID : github .String ("W_456" ),
65+ URL : github .Ptr ("https://api.github.com/repos/owner/repo/actions/workflows/456" ),
66+ HTMLURL : github .Ptr ("https://github.com/owner/repo/actions/workflows/deploy.yml" ),
67+ BadgeURL : github .Ptr ("https://github.com/owner/repo/workflows/Deploy/badge.svg" ),
68+ NodeID : github .Ptr ("W_456" ),
6969 },
7070 },
7171 }
@@ -411,44 +411,44 @@ func Test_ListWorkflowRunArtifacts(t *testing.T) {
411411 mock .GetReposActionsRunsArtifactsByOwnerByRepoByRunId ,
412412 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
413413 artifacts := & github.ArtifactList {
414- TotalCount : github .Int64 ( 2 ),
414+ TotalCount : github .Ptr ( int64 ( 2 ) ),
415415 Artifacts : []* github.Artifact {
416416 {
417- ID : github .Int64 ( 1 ),
418- NodeID : github .String ("A_1" ),
419- Name : github .String ("build-artifacts" ),
420- SizeInBytes : github .Int64 ( 1024 ),
421- URL : github .String ("https://api.github.com/repos/owner/repo/actions/artifacts/1" ),
422- ArchiveDownloadURL : github .String ("https://api.github.com/repos/owner/repo/actions/artifacts/1/zip" ),
423- Expired : github .Bool (false ),
417+ ID : github .Ptr ( int64 ( 1 ) ),
418+ NodeID : github .Ptr ("A_1" ),
419+ Name : github .Ptr ("build-artifacts" ),
420+ SizeInBytes : github .Ptr ( int64 ( 1024 ) ),
421+ URL : github .Ptr ("https://api.github.com/repos/owner/repo/actions/artifacts/1" ),
422+ ArchiveDownloadURL : github .Ptr ("https://api.github.com/repos/owner/repo/actions/artifacts/1/zip" ),
423+ Expired : github .Ptr (false ),
424424 CreatedAt : & github.Timestamp {},
425425 UpdatedAt : & github.Timestamp {},
426426 ExpiresAt : & github.Timestamp {},
427427 WorkflowRun : & github.ArtifactWorkflowRun {
428- ID : github .Int64 ( 12345 ),
429- RepositoryID : github .Int64 ( 1 ),
430- HeadRepositoryID : github .Int64 ( 1 ),
431- HeadBranch : github .String ("main" ),
432- HeadSHA : github .String ("abc123" ),
428+ ID : github .Ptr ( int64 ( 12345 ) ),
429+ RepositoryID : github .Ptr ( int64 ( 1 ) ),
430+ HeadRepositoryID : github .Ptr ( int64 ( 1 ) ),
431+ HeadBranch : github .Ptr ("main" ),
432+ HeadSHA : github .Ptr ("abc123" ),
433433 },
434434 },
435435 {
436- ID : github .Int64 ( 2 ),
437- NodeID : github .String ("A_2" ),
438- Name : github .String ("test-results" ),
439- SizeInBytes : github .Int64 ( 512 ),
440- URL : github .String ("https://api.github.com/repos/owner/repo/actions/artifacts/2" ),
441- ArchiveDownloadURL : github .String ("https://api.github.com/repos/owner/repo/actions/artifacts/2/zip" ),
442- Expired : github .Bool (false ),
436+ ID : github .Ptr ( int64 ( 2 ) ),
437+ NodeID : github .Ptr ("A_2" ),
438+ Name : github .Ptr ("test-results" ),
439+ SizeInBytes : github .Ptr ( int64 ( 512 ) ),
440+ URL : github .Ptr ("https://api.github.com/repos/owner/repo/actions/artifacts/2" ),
441+ ArchiveDownloadURL : github .Ptr ("https://api.github.com/repos/owner/repo/actions/artifacts/2/zip" ),
442+ Expired : github .Ptr (false ),
443443 CreatedAt : & github.Timestamp {},
444444 UpdatedAt : & github.Timestamp {},
445445 ExpiresAt : & github.Timestamp {},
446446 WorkflowRun : & github.ArtifactWorkflowRun {
447- ID : github .Int64 ( 12345 ),
448- RepositoryID : github .Int64 ( 1 ),
449- HeadRepositoryID : github .Int64 ( 1 ),
450- HeadBranch : github .String ("main" ),
451- HeadSHA : github .String ("abc123" ),
447+ ID : github .Ptr ( int64 ( 12345 ) ),
448+ RepositoryID : github .Ptr ( int64 ( 1 ) ),
449+ HeadRepositoryID : github .Ptr ( int64 ( 1 ) ),
450+ HeadBranch : github .Ptr ("main" ),
451+ HeadSHA : github .Ptr ("abc123" ),
452452 },
453453 },
454454 },
@@ -708,21 +708,21 @@ func Test_GetWorkflowRunUsage(t *testing.T) {
708708 usage := & github.WorkflowRunUsage {
709709 Billable : & github.WorkflowRunBillMap {
710710 "UBUNTU" : & github.WorkflowRunBill {
711- TotalMS : github .Int64 ( 120000 ),
712- Jobs : github .Int (2 ),
711+ TotalMS : github .Ptr ( int64 ( 120000 ) ),
712+ Jobs : github .Ptr (2 ),
713713 JobRuns : []* github.WorkflowRunJobRun {
714714 {
715- JobID : github .Int (1 ),
716- DurationMS : github .Int64 ( 60000 ),
715+ JobID : github .Ptr (1 ),
716+ DurationMS : github .Ptr ( int64 ( 60000 ) ),
717717 },
718718 {
719- JobID : github .Int (2 ),
720- DurationMS : github .Int64 ( 60000 ),
719+ JobID : github .Ptr (2 ),
720+ DurationMS : github .Ptr ( int64 ( 60000 ) ),
721721 },
722722 },
723723 },
724724 },
725- RunDurationMS : github .Int64 ( 120000 ),
725+ RunDurationMS : github .Ptr ( int64 ( 120000 ) ),
726726 }
727727 w .WriteHeader (http .StatusOK )
728728 _ = json .NewEncoder (w ).Encode (usage )
@@ -835,22 +835,22 @@ func Test_GetJobLogs(t *testing.T) {
835835 mock .GetReposActionsRunsJobsByOwnerByRepoByRunId ,
836836 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
837837 jobs := & github.Jobs {
838- TotalCount : github .Int (3 ),
838+ TotalCount : github .Ptr (3 ),
839839 Jobs : []* github.WorkflowJob {
840840 {
841- ID : github .Int64 ( 1 ),
842- Name : github .String ("test-job-1" ),
843- Conclusion : github .String ("success" ),
841+ ID : github .Ptr ( int64 ( 1 ) ),
842+ Name : github .Ptr ("test-job-1" ),
843+ Conclusion : github .Ptr ("success" ),
844844 },
845845 {
846- ID : github .Int64 ( 2 ),
847- Name : github .String ("test-job-2" ),
848- Conclusion : github .String ("failure" ),
846+ ID : github .Ptr ( int64 ( 2 ) ),
847+ Name : github .Ptr ("test-job-2" ),
848+ Conclusion : github .Ptr ("failure" ),
849849 },
850850 {
851- ID : github .Int64 ( 3 ),
852- Name : github .String ("test-job-3" ),
853- Conclusion : github .String ("failure" ),
851+ ID : github .Ptr ( int64 ( 3 ) ),
852+ Name : github .Ptr ("test-job-3" ),
853+ Conclusion : github .Ptr ("failure" ),
854854 },
855855 },
856856 }
@@ -892,17 +892,17 @@ func Test_GetJobLogs(t *testing.T) {
892892 mock .GetReposActionsRunsJobsByOwnerByRepoByRunId ,
893893 http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
894894 jobs := & github.Jobs {
895- TotalCount : github .Int (2 ),
895+ TotalCount : github .Ptr (2 ),
896896 Jobs : []* github.WorkflowJob {
897897 {
898- ID : github .Int64 ( 1 ),
899- Name : github .String ("test-job-1" ),
900- Conclusion : github .String ("success" ),
898+ ID : github .Ptr ( int64 ( 1 ) ),
899+ Name : github .Ptr ("test-job-1" ),
900+ Conclusion : github .Ptr ("success" ),
901901 },
902902 {
903- ID : github .Int64 ( 2 ),
904- Name : github .String ("test-job-2" ),
905- Conclusion : github .String ("success" ),
903+ ID : github .Ptr ( int64 ( 2 ) ),
904+ Name : github .Ptr ("test-job-2" ),
905+ Conclusion : github .Ptr ("success" ),
906906 },
907907 },
908908 }
0 commit comments