Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (

type PluginConfig struct {
Token string `mapstructure:"token"`
Organisation *string `mapstructure:"organisation"`
Organization *string `mapstructure:"organization"`
User *string `mapstructure:"user"`
}

Expand Down Expand Up @@ -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,
},
Expand Down Expand Up @@ -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"),
Expand All @@ -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"),
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions main_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
}
Expand Down Expand Up @@ -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")),
}
Expand Down