@@ -41,31 +41,31 @@ func Test_ListWorkflows(t *testing.T) {
41
41
mock .GetReposActionsWorkflowsByOwnerByRepo ,
42
42
http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
43
43
workflows := & github.Workflows {
44
- TotalCount : github .Int (2 ),
44
+ TotalCount : github .Ptr (2 ),
45
45
Workflows : []* github.Workflow {
46
46
{
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" ),
51
51
CreatedAt : & github.Timestamp {},
52
52
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" ),
57
57
},
58
58
{
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" ),
63
63
CreatedAt : & github.Timestamp {},
64
64
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" ),
69
69
},
70
70
},
71
71
}
@@ -411,44 +411,44 @@ func Test_ListWorkflowRunArtifacts(t *testing.T) {
411
411
mock .GetReposActionsRunsArtifactsByOwnerByRepoByRunId ,
412
412
http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
413
413
artifacts := & github.ArtifactList {
414
- TotalCount : github .Int64 ( 2 ),
414
+ TotalCount : github .Ptr ( int64 ( 2 ) ),
415
415
Artifacts : []* github.Artifact {
416
416
{
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 ),
424
424
CreatedAt : & github.Timestamp {},
425
425
UpdatedAt : & github.Timestamp {},
426
426
ExpiresAt : & github.Timestamp {},
427
427
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" ),
433
433
},
434
434
},
435
435
{
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 ),
443
443
CreatedAt : & github.Timestamp {},
444
444
UpdatedAt : & github.Timestamp {},
445
445
ExpiresAt : & github.Timestamp {},
446
446
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" ),
452
452
},
453
453
},
454
454
},
@@ -708,21 +708,21 @@ func Test_GetWorkflowRunUsage(t *testing.T) {
708
708
usage := & github.WorkflowRunUsage {
709
709
Billable : & github.WorkflowRunBillMap {
710
710
"UBUNTU" : & github.WorkflowRunBill {
711
- TotalMS : github .Int64 ( 120000 ),
712
- Jobs : github .Int (2 ),
711
+ TotalMS : github .Ptr ( int64 ( 120000 ) ),
712
+ Jobs : github .Ptr (2 ),
713
713
JobRuns : []* github.WorkflowRunJobRun {
714
714
{
715
- JobID : github .Int (1 ),
716
- DurationMS : github .Int64 ( 60000 ),
715
+ JobID : github .Ptr (1 ),
716
+ DurationMS : github .Ptr ( int64 ( 60000 ) ),
717
717
},
718
718
{
719
- JobID : github .Int (2 ),
720
- DurationMS : github .Int64 ( 60000 ),
719
+ JobID : github .Ptr (2 ),
720
+ DurationMS : github .Ptr ( int64 ( 60000 ) ),
721
721
},
722
722
},
723
723
},
724
724
},
725
- RunDurationMS : github .Int64 ( 120000 ),
725
+ RunDurationMS : github .Ptr ( int64 ( 120000 ) ),
726
726
}
727
727
w .WriteHeader (http .StatusOK )
728
728
_ = json .NewEncoder (w ).Encode (usage )
@@ -835,22 +835,22 @@ func Test_GetJobLogs(t *testing.T) {
835
835
mock .GetReposActionsRunsJobsByOwnerByRepoByRunId ,
836
836
http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
837
837
jobs := & github.Jobs {
838
- TotalCount : github .Int (3 ),
838
+ TotalCount : github .Ptr (3 ),
839
839
Jobs : []* github.WorkflowJob {
840
840
{
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" ),
844
844
},
845
845
{
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" ),
849
849
},
850
850
{
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" ),
854
854
},
855
855
},
856
856
}
@@ -892,17 +892,17 @@ func Test_GetJobLogs(t *testing.T) {
892
892
mock .GetReposActionsRunsJobsByOwnerByRepoByRunId ,
893
893
http .HandlerFunc (func (w http.ResponseWriter , _ * http.Request ) {
894
894
jobs := & github.Jobs {
895
- TotalCount : github .Int (2 ),
895
+ TotalCount : github .Ptr (2 ),
896
896
Jobs : []* github.WorkflowJob {
897
897
{
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" ),
901
901
},
902
902
{
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" ),
906
906
},
907
907
},
908
908
}
0 commit comments