From 1a93308751b9fc1b0f51e1cf7dbd6d3db57c79f8 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 13 Apr 2025 08:48:51 +0200 Subject: [PATCH] Update to american selling or organization --- main.go | 20 ++++++++++---------- main_integration_test.go | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/main.go b/main.go index 285fcfb..dcc043c 100644 --- a/main.go +++ b/main.go @@ -15,7 +15,7 @@ import ( type PluginConfig struct { Token string `mapstructure:"token"` - Organisation *string `mapstructure:"organisation"` + Organization *string `mapstructure:"organization"` User *string `mapstructure:"user"` } @@ -114,7 +114,7 @@ func (l *DependabotPlugin) FetchRepositories(ctx context.Context) (<-chan *githu done := false for !done { l.logger.Trace("Fetching repositories from Github API") - repos, _, err := l.githubClient.Repositories.ListByOrg(ctx, *l.config.Organisation, &github.RepositoryListByOrgOptions{ + repos, _, err := l.githubClient.Repositories.ListByOrg(ctx, *l.config.Organization, &github.RepositoryListByOrgOptions{ ListOptions: github.ListOptions{ Page: page, }, @@ -162,7 +162,7 @@ func (l *DependabotPlugin) EvaluatePolicies(ctx context.Context, repo *github.Re "provider": "github", "type": "repository", "repository-name": repo.GetName(), - "organisation": repo.GetOwner().GetLogin(), + "organization": repo.GetOwner().GetLogin(), "url": repo.GetURL(), }, Title: policyManager.Pointer("Software Repository"), @@ -180,24 +180,24 @@ func (l *DependabotPlugin) EvaluatePolicies(ctx context.Context, repo *github.Re }, }, { - Type: "software-organisation", + Type: "software-organization", Attributes: map[string]string{ "provider": "github", - "type": "organisation", - "organisation-name": repo.GetOrganization().GetName(), - "organisation-path": repo.GetOrganization().GetLogin(), + "type": "organization", + "organization-name": repo.GetOrganization().GetName(), + "organization-path": repo.GetOrganization().GetLogin(), }, - Title: policyManager.Pointer("Software Organisation"), + Title: policyManager.Pointer("Software Organization"), Props: []*proto.Property{ { - Name: "organisation", + Name: "organization", Value: repo.GetOrganization().GetName(), }, }, Links: []*proto.Link{ { Href: repo.GetOrganization().GetURL(), - Text: policyManager.Pointer("Organisation URL"), + Text: policyManager.Pointer("Organization URL"), }, }, }, diff --git a/main_integration_test.go b/main_integration_test.go index ed61194..f2803c7 100644 --- a/main_integration_test.go +++ b/main_integration_test.go @@ -19,7 +19,7 @@ func TestDependabotPlugin_Integration_FetchRepositories(t *testing.T) { logger: hclog.NewNullLogger(), config: &PluginConfig{ Token: os.Getenv("GITHUB_TOKEN"), - Organisation: policy_manager.Pointer("compliance-framework"), + Organization: policy_manager.Pointer("compliance-framework"), }, githubClient: github.NewClient(nil).WithAuthToken(os.Getenv("GITHUB_TOKEN")), } @@ -59,7 +59,7 @@ func TestDependabotPlugin_Integration_FetchRepositoryDependabotAlerts(t *testing }), config: &PluginConfig{ Token: os.Getenv("GITHUB_TOKEN"), - Organisation: policy_manager.Pointer("compliance-framework"), + Organization: policy_manager.Pointer("compliance-framework"), }, githubClient: github.NewClient(nil).WithAuthToken(os.Getenv("GITHUB_TOKEN")), }