From 5862df64ab37c917baad4310c05d079aac59c0ca Mon Sep 17 00:00:00 2001 From: candiduslynx Date: Fri, 31 Mar 2023 18:33:05 +0300 Subject: [PATCH 1/2] use cursor-based sync for dependabot --- .../source/github/resources/services/organizations/alerts.go | 2 +- .../source/github/resources/services/repositories/alerts.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/source/github/resources/services/organizations/alerts.go b/plugins/source/github/resources/services/organizations/alerts.go index be11cad106d581..9566a1d2b12c0f 100644 --- a/plugins/source/github/resources/services/organizations/alerts.go +++ b/plugins/source/github/resources/services/organizations/alerts.go @@ -29,7 +29,7 @@ func fetchAlerts(ctx context.Context, meta schema.ClientMeta, _ *schema.Resource } res <- alerts opts.After = resp.After - if resp.After == "" { + if len(opts.After) == 0 { break } } diff --git a/plugins/source/github/resources/services/repositories/alerts.go b/plugins/source/github/resources/services/repositories/alerts.go index 8a1ae4b72635bd..93963eddb0a9c8 100644 --- a/plugins/source/github/resources/services/repositories/alerts.go +++ b/plugins/source/github/resources/services/repositories/alerts.go @@ -2,7 +2,6 @@ package repositories import ( "context" - "strconv" "github.com/cloudquery/cloudquery/plugins/source/github/client" "github.com/cloudquery/plugin-sdk/schema" @@ -30,8 +29,8 @@ func fetchAlerts(ctx context.Context, meta schema.ClientMeta, parent *schema.Res return err } res <- alerts - opts.Page = strconv.FormatInt(int64(resp.NextPage), 10) - if resp.NextPage == 0 { + opts.After = resp.After + if len(resp.After) == 0 { break } } From 02a6eb461072f1bbf33a1644e0d66d812093922f Mon Sep 17 00:00:00 2001 From: candiduslynx Date: Fri, 31 Mar 2023 19:25:43 +0300 Subject: [PATCH 2/2] Update plugins/source/github/resources/services/organizations/alerts.go Co-authored-by: Herman Schaaf --- .../source/github/resources/services/organizations/alerts.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/source/github/resources/services/organizations/alerts.go b/plugins/source/github/resources/services/organizations/alerts.go index 9566a1d2b12c0f..91600862b426e8 100644 --- a/plugins/source/github/resources/services/organizations/alerts.go +++ b/plugins/source/github/resources/services/organizations/alerts.go @@ -29,7 +29,7 @@ func fetchAlerts(ctx context.Context, meta schema.ClientMeta, _ *schema.Resource } res <- alerts opts.After = resp.After - if len(opts.After) == 0 { + if len(resp.After) == 0 { break } }