From 90248d4ce819d8c2d9ab3fa78ffcc5bed399ab72 Mon Sep 17 00:00:00 2001 From: ganeshkumarsv <53483484+ganeshkumarsv@users.noreply.github.com> Date: Sun, 19 Sep 2021 08:43:18 -0400 Subject: [PATCH 1/4] adding pagination fields to code scanning --- github/code-scanning.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/github/code-scanning.go b/github/code-scanning.go index dbaeb346b3f..83f5141b275 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -115,6 +115,12 @@ type AlertListOptions struct { // Return code scanning alerts for a specific branch reference. The ref must be formatted as heads/. Ref string `url:"ref,omitempty"` + + // Returns the results based on Page number. Page number is set to 1 by default + Page string `url:"page,omitempty"` + + // Results per page. Maximum is 100 results page + PerPage int `url:"per_page,omitempty"` } // ListAlertsForRepo lists code scanning alerts for a repository. From b15770002a9a0bfde32ccf77dda00ba3634549ce Mon Sep 17 00:00:00 2001 From: ganeshkumarsv <53483484+ganeshkumarsv@users.noreply.github.com> Date: Sun, 19 Sep 2021 11:43:29 -0400 Subject: [PATCH 2/4] go fmt on code-scanning.go --- github/code-scanning.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github/code-scanning.go b/github/code-scanning.go index 83f5141b275..e984a310d1c 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -115,12 +115,12 @@ type AlertListOptions struct { // Return code scanning alerts for a specific branch reference. The ref must be formatted as heads/. Ref string `url:"ref,omitempty"` - + // Returns the results based on Page number. Page number is set to 1 by default Page string `url:"page,omitempty"` // Results per page. Maximum is 100 results page - PerPage int `url:"per_page,omitempty"` + PerPage int `url:"per_page,omitempty"` } // ListAlertsForRepo lists code scanning alerts for a repository. From 4f19006431a2f1aa407aad0c33a5d17d304d59df Mon Sep 17 00:00:00 2001 From: ganeshkumarsv <53483484+ganeshkumarsv@users.noreply.github.com> Date: Sun, 19 Sep 2021 14:55:49 -0400 Subject: [PATCH 3/4] Fixing the datatype of Page field --- github/code-scanning.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/code-scanning.go b/github/code-scanning.go index e984a310d1c..c49420b22c0 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -117,7 +117,7 @@ type AlertListOptions struct { Ref string `url:"ref,omitempty"` // Returns the results based on Page number. Page number is set to 1 by default - Page string `url:"page,omitempty"` + Page int `url:"page,omitempty"` // Results per page. Maximum is 100 results page PerPage int `url:"per_page,omitempty"` From 31bfc67d6dcd12b4e2921f8cfbe4ef66ca2fbad6 Mon Sep 17 00:00:00 2001 From: ganeshkumarsv <53483484+ganeshkumarsv@users.noreply.github.com> Date: Mon, 20 Sep 2021 11:29:27 -0400 Subject: [PATCH 4/4] Update github/code-scanning.go Co-authored-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com> --- github/code-scanning.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/github/code-scanning.go b/github/code-scanning.go index c49420b22c0..50264a0c3ba 100644 --- a/github/code-scanning.go +++ b/github/code-scanning.go @@ -116,11 +116,7 @@ type AlertListOptions struct { // Return code scanning alerts for a specific branch reference. The ref must be formatted as heads/. Ref string `url:"ref,omitempty"` - // Returns the results based on Page number. Page number is set to 1 by default - Page int `url:"page,omitempty"` - - // Results per page. Maximum is 100 results page - PerPage int `url:"per_page,omitempty"` + ListOptions } // ListAlertsForRepo lists code scanning alerts for a repository.