From 95cbd28b13bcb2c1a0b4173e39eb8d49ced9ea23 Mon Sep 17 00:00:00 2001 From: htrgouvea Date: Thu, 28 Nov 2024 18:43:19 +0000 Subject: [PATCH 1/9] update README --- README.md | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 3be757f..a59d0e5 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,16 @@

Sentra

-

The first autonomous source code posture risk score tool.

+

The first autonomous source code posture risk score tool

+ + + + + +

@@ -16,16 +22,6 @@ Sentra is a collection of Perl modules designed to help gain speed and increase --- -### Modules - -| Name | Description | -|------|-------------| -| DependabotMetrics | Fetches and analyzes Dependabot alerts from GitHub repositories of a specified organization. | -| SearchFiles | Checks repositories for specific files and last update times. | -| SlackWebhook | An output forwarder for sending messages to Slack via webhooks. | - ---- - ### Installation ```bash @@ -43,18 +39,25 @@ $ cpanm --installdeps . ``` $ perl sentra.pl -Sentra v0.0.1 +Sentra v0.0.3 Core Commands ============== Command Description ------- ----------- -o, --org Specify the name of the organization -t, --token Set the GitHub Token to use during actions --w, --webhook Set the webhook address for Slack --m, --message Message to send via Slack webhook -mt, --maintained Check last commit date of repositories -d, --dependency Check for dependabot.yaml file in repositories --p, --per_page Set the number of items per page in API requests (default: 100) +-M, --metrics See some metrics based on GHAS +-w, --webhook Set the webhook address for Slack +-m, --message Message to send via Slack webhook +``` + +--- + +### Workflows examples + +```yaml ``` --- @@ -67,4 +70,4 @@ Your contributions and suggestions are heartily ♥ welcome. [See here the contr ### License -This work is licensed under [MIT License.](/LICENSE.md) +This work is licensed under [MIT License.](/LICENSE.md) \ No newline at end of file From ca1e3af65b673a3e0416f68c0bfa2f261d9bbf8b Mon Sep 17 00:00:00 2001 From: htrgouvea Date: Thu, 28 Nov 2024 21:34:25 +0000 Subject: [PATCH 2/9] better code composition --- lib/Sentra/Engine/SearchFiles.pm | 36 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/Sentra/Engine/SearchFiles.pm b/lib/Sentra/Engine/SearchFiles.pm index 0b2f3ad..0603bd0 100644 --- a/lib/Sentra/Engine/SearchFiles.pm +++ b/lib/Sentra/Engine/SearchFiles.pm @@ -15,27 +15,27 @@ package Sentra::Engine::SearchFiles { 'X-GitHub-Api-Version' => '2022-11-28' }; - my $output = ''; - + my $output = ''; my $repo_url = "https://api.github.com/orgs/$org/repos?per_page=$per_page"; - my $repo_tx = $userAgent -> get($repo_url => $headers); - - my $res = $repo_tx->result or return "Error fetching repositories: " . $repo_tx->error->{message} . "\n"; - $res->is_success or return "Error fetching repositories: " . $res->message . "\n"; + my $repo_tx = $userAgent -> get($repo_url => $headers); - my $repos = $res->json; + my $res = $repo_tx -> result(); + + if ($res -> is_success) { + my $repos = $res -> json(); - for my $repo (@$repos) { - next if $repo -> {archived}; - - my $full_name = "$org/$repo->{name}"; - - my $dependabot_url = "https://api.github.com/repos/$full_name/contents/.github/dependabot.yaml"; - my $dependabot_tx = $userAgent->get($dependabot_url => $headers); - - if ($dependabot_tx->result->code == 404) { - $output .= "The dependabot.yml file was not found in this repository: https://github.com/$full_name\n"; - } + for my $repo (@$repos) { + next if $repo -> {archived}; + + my $full_name = "$org/$repo->{name}"; + + my $dependabot_url = "https://api.github.com/repos/$full_name/contents/.github/dependabot.yaml"; + my $dependabot_tx = $userAgent -> get($dependabot_url => $headers); + + if ($dependabot_tx -> result -> code == 404) { + $output .= "The dependabot.yml file was not found in this repository: https://github.com/$full_name\n"; + } + } } return $output || "No issues found."; From 9c27e5eba7b2aed0d357f0e5629a67e032c98ab0 Mon Sep 17 00:00:00 2001 From: htrgouvea Date: Thu, 28 Nov 2024 21:37:09 +0000 Subject: [PATCH 3/9] better code composition --- lib/Sentra/Engine/Maintained.pm | 54 ++++++++++++++++----------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/lib/Sentra/Engine/Maintained.pm b/lib/Sentra/Engine/Maintained.pm index d1ddffc..2e83a52 100644 --- a/lib/Sentra/Engine/Maintained.pm +++ b/lib/Sentra/Engine/Maintained.pm @@ -17,37 +17,35 @@ package Sentra::Engine::Maintained { 'X-GitHub-Api-Version' => '2022-11-28' }; - my $output = ''; - + my $output = ''; my $repo_url = "https://api.github.com/orgs/$org/repos?per_page=$per_page"; - my $repo_tx = $userAgent -> get($repo_url => $headers); - - my $res = $repo_tx -> result or return "Error fetching repositories: " . $repo_tx->error->{message} . "\n"; - $res -> is_success or return "Error fetching repositories: " . $res->message . "\n"; - - my $repos = $res->json; + my $repo_tx = $userAgent -> get($repo_url => $headers); + my $res = $repo_tx -> result(); - for my $repo (@$repos) { - next if $repo -> {archived}; - - my $full_name = "$org/$repo->{name}"; - - - my $commits_url = "https://api.github.com/repos/$full_name/commits"; - my $commits_tx = $userAgent->get($commits_url => $headers); - my $commits_res = $commits_tx->result; - - if ($commits_res && $commits_res->is_success) { - my $commits = $commits_res->json; - - if (@$commits) { - my $last_commit_date_str = $commits->[0]{commit}{committer}{date}; - my $last_commit_date = DateTime::Format::ISO8601->parse_datetime($last_commit_date_str); + if ($res -> is_success) { + my $repos = $res->json; + + for my $repo (@$repos) { + next if $repo -> {archived}; + + my $full_name = "$org/$repo->{name}"; + my $commits_url = "https://api.github.com/repos/$full_name/commits"; + my $commits_tx = $userAgent -> get($commits_url => $headers); + my $commits_res = $commits_tx -> result; + + if ($commits_res && $commits_res->is_success) { + my $commits = $commits_res->json; - $output .= "The repository https://github.com/$full_name has not been updated for more than 90 days.\n" - if DateTime -> now -> subtract(days => 90) > $last_commit_date; - } - } + if (@$commits) { + my $last_commit_date_str = $commits->[0]{commit}{committer}{date}; + my $last_commit_date = DateTime::Format::ISO8601 -> parse_datetime($last_commit_date_str); + + if (DateTime -> now -> subtract(days => 90) > $last_commit_date) { + $output .= "The repository https://github.com/$full_name has not been updated for more than 90 days.\n"; + } + } + } + } } return $output || "No issues found."; From 376ca5b98412ca12c1ac8f84b27ac9f2fea77a3e Mon Sep 17 00:00:00 2001 From: htrgouvea Date: Thu, 28 Nov 2024 21:41:05 +0000 Subject: [PATCH 4/9] just some adjusts --- lib/Sentra/Engine/SlackWebhook.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Sentra/Engine/SlackWebhook.pm b/lib/Sentra/Engine/SlackWebhook.pm index ecf9d42..04fd86d 100644 --- a/lib/Sentra/Engine/SlackWebhook.pm +++ b/lib/Sentra/Engine/SlackWebhook.pm @@ -10,18 +10,18 @@ package Sentra::Engine::SlackWebhook { my $userAgent = Mojo::UserAgent -> new(); my $payload = encode_json({text => $message}); - my $tx = $userAgent -> post($webhook => { + my $text = $userAgent -> post($webhook => { 'Content-Type' => 'application/json' } => $payload); - my $res = $tx -> result; + my $res = $text -> result; unless ($res) { - my $err = $tx->error; + my $err = $text -> error; return "Failed to send message: [" . ($err->{message} || "Unknown error") . "]\n"; } - return "Failed to send message: [" . $res->message . "]\n" unless $res->is_success; + return "Failed to send message: [" . $res->message . "]\n" unless $res -> is_success; return "Message sent successfully! [" . $res->body . "]\n"; } From e71b196c6687005e09f5ead35418bc3b1c8c1a7d Mon Sep 17 00:00:00 2001 From: htrgouvea Date: Thu, 28 Nov 2024 21:41:22 +0000 Subject: [PATCH 5/9] draft new modules --- lib/Sentra/Utils/Github.pm | 10 ++++++++++ lib/Sentra/Utils/UserAgent.pm | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 lib/Sentra/Utils/Github.pm create mode 100644 lib/Sentra/Utils/UserAgent.pm diff --git a/lib/Sentra/Utils/Github.pm b/lib/Sentra/Utils/Github.pm new file mode 100644 index 0000000..d10a473 --- /dev/null +++ b/lib/Sentra/Utils/Github.pm @@ -0,0 +1,10 @@ +package Sentra::Utils::Github { + use strict; + use warnings; + + sub new { + return 1; + } +} + +1; \ No newline at end of file diff --git a/lib/Sentra/Utils/UserAgent.pm b/lib/Sentra/Utils/UserAgent.pm new file mode 100644 index 0000000..7f1d511 --- /dev/null +++ b/lib/Sentra/Utils/UserAgent.pm @@ -0,0 +1,20 @@ +package Sentra::Utils::UserAgent { + use strict; + use warnings; + use Mojo::UserAgent; + + sub new { + my $userAgent = Mojo::UserAgent -> new(); + + my $headers = { + 'X-GitHub-Api-Version' => '2022-11-28', + 'Accept' => 'application/vnd.github+json', + 'User-Agent' => 'Sentra 0.0.3', + 'Authorization' => "Bearer $token" + }; + + return ""; + } +} + +1; \ No newline at end of file From 799c138dc3ba3ebbc5a96a4eccdec4d311915f7d Mon Sep 17 00:00:00 2001 From: htrgouvea Date: Thu, 28 Nov 2024 21:46:29 +0000 Subject: [PATCH 6/9] improviments on message descriptions --- lib/Sentra/Utils/Helper.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Sentra/Utils/Helper.pm b/lib/Sentra/Utils/Helper.pm index 5205ebc..efeff35 100644 --- a/lib/Sentra/Utils/Helper.pm +++ b/lib/Sentra/Utils/Helper.pm @@ -11,8 +11,8 @@ package Sentra::Utils::Helper { \r\t------- ----------- \r\t-o, --org Specify the name of the organization \r\t-t, --token Set the GitHub Token to use during actions - \r\t-mt, --maintained Check last commit date of repositories - \r\t-d, --dependency Check for dependabot.yaml file in repositories + \r\t-mt, --maintained Get alerts about repositories with a last commit date greater than 90 days old + \r\t-d, --dependency Check if repositories has dependabot.yaml file \r\t-M, --metrics See some metrics based on GHAS \r\t-w, --webhook Set the webhook address for Slack \r\t-m, --message Message to send via Slack webhook\n\n"; From 8e7de8a93b24b058fe54957c99645006b05c9ef5 Mon Sep 17 00:00:00 2001 From: htrgouvea Date: Thu, 28 Nov 2024 21:47:14 +0000 Subject: [PATCH 7/9] code style fix --- sentra.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sentra.pl b/sentra.pl index 7e550da..c8e5d86 100644 --- a/sentra.pl +++ b/sentra.pl @@ -3,20 +3,20 @@ use 5.030; use strict; use warnings; -use Getopt::Long qw(:config no_ignore_case); use lib './lib/'; -use Sentra::Engine::DependabotMetrics; +use Getopt::Long qw(:config no_ignore_case); +use Sentra::Utils::Helper; +use Sentra::Engine::Maintained; use Sentra::Engine::SearchFiles; use Sentra::Engine::SlackWebhook; -use Sentra::Engine::Maintained; -use Sentra::Utils::Helper; +use Sentra::Engine::DependabotMetrics; sub main { my ($org, $token, $webhook, $message, $help, %options); my $per_page = 100; - GetOptions( + GetOptions ( 'o|org=s' => \$org, 't|token=s' => \$token, 'w|webhook=s' => \$webhook, @@ -40,7 +40,7 @@ sub main { } if ($webhook && $message) { - Sentra::Engine::SlackWebhook->new($message, $webhook)->send(); + return Sentra::Engine::SlackWebhook -> new($message, $webhook) -> send(); } if ($help) { From bbbe48b60c7e25c5015d424cb4252cba275d4989 Mon Sep 17 00:00:00 2001 From: htrgouvea Date: Fri, 29 Nov 2024 12:42:03 +0000 Subject: [PATCH 8/9] new modules to optmize --- lib/Sentra/Utils/Repositories_List.pm | 37 +++++++++++++++++++++++++++ lib/Sentra/Utils/UserAgent.pm | 20 ++++++++++----- 2 files changed, 51 insertions(+), 6 deletions(-) create mode 100644 lib/Sentra/Utils/Repositories_List.pm diff --git a/lib/Sentra/Utils/Repositories_List.pm b/lib/Sentra/Utils/Repositories_List.pm new file mode 100644 index 0000000..b2ce4be --- /dev/null +++ b/lib/Sentra/Utils/Repositories_List.pm @@ -0,0 +1,37 @@ +package Sentra::Utils::Repositories_List { + use strict; + use warnings; + use JSON; + use Sentra::Utils::UserAgent; + + sub new { + my ($self, $org, $token) = @_; + + my @repos; + my $page = 1; + my $userAgent = Sentra::Utils::UserAgent -> new($token); + + while (1) { + my $url = "https://api.github.com/orgs/$org/repos?per_page=100&page=$page"; + my $response = $userAgent -> get($url); + + if ($response -> code() == 200) { + my $data = decode_json($response -> content()); + + if (scalar(@$data) == 0) { + last; + } + + for my $repo (@$data) { + push @repos, "$org/$repo->{name}" unless $repo->{archived}; + } + + $page++; + } + } + + return @repos; + } +} + +1; \ No newline at end of file diff --git a/lib/Sentra/Utils/UserAgent.pm b/lib/Sentra/Utils/UserAgent.pm index 7f1d511..c75b65c 100644 --- a/lib/Sentra/Utils/UserAgent.pm +++ b/lib/Sentra/Utils/UserAgent.pm @@ -1,19 +1,27 @@ package Sentra::Utils::UserAgent { use strict; use warnings; - use Mojo::UserAgent; + use LWP::UserAgent; sub new { - my $userAgent = Mojo::UserAgent -> new(); + my ($self, $token) = @_; + + my $userAgent = LWP::UserAgent -> new( + timeout => 5, + ssl_opts => { + verify_hostname => 0, + SSL_verify_mode => 0 + }, + agent => "Sentra 0.0.3" + ); - my $headers = { + $userAgent -> default_headers -> header ( 'X-GitHub-Api-Version' => '2022-11-28', 'Accept' => 'application/vnd.github+json', - 'User-Agent' => 'Sentra 0.0.3', 'Authorization' => "Bearer $token" - }; + ); - return ""; + return $userAgent; } } From 3a9481746aa55c32cef7e070452db162c5d0e21a Mon Sep 17 00:00:00 2001 From: htrgouvea Date: Fri, 29 Nov 2024 12:42:29 +0000 Subject: [PATCH 9/9] using the new utils modules --- lib/Sentra/Engine/DependabotMetrics.pm | 62 +++++++------------------- lib/Sentra/Engine/Maintained.pm | 53 ++++++++-------------- lib/Sentra/Engine/SearchFiles.pm | 43 ++++++------------ lib/Sentra/Utils/Github.pm | 10 ----- sentra.pl | 6 +-- 5 files changed, 49 insertions(+), 125 deletions(-) delete mode 100644 lib/Sentra/Utils/Github.pm diff --git a/lib/Sentra/Engine/DependabotMetrics.pm b/lib/Sentra/Engine/DependabotMetrics.pm index 557905d..4628e2a 100644 --- a/lib/Sentra/Engine/DependabotMetrics.pm +++ b/lib/Sentra/Engine/DependabotMetrics.pm @@ -1,42 +1,17 @@ package Sentra::Engine::DependabotMetrics { use strict; use warnings; - use Mojo::UserAgent; - use Mojo::JSON qw(decode_json); + use JSON; + use Sentra::Utils::UserAgent; + use Sentra::Utils::Repositories_List; sub new { my ($class, $org, $token, $per_page) = @_; - my $userAgent = Mojo::UserAgent -> new(); + my $userAgent = Sentra::Utils::UserAgent -> new($token); + my @repositories_list = Sentra::Utils::Repositories_List -> new($org, $token); - my $headers = { - 'X-GitHub-Api-Version' => '2022-11-28', - 'Accept' => 'application/vnd.github+json', - 'User-Agent' => 'Sentra 0.0.3', - 'Authorization' => "Bearer $token" - }; - - my @repos; - my $repo_page = 1; - - while (1) { - my $repo_url = "https://api.github.com/orgs/$org/repos?per_page=$per_page&page=$repo_page"; - my $repo_tx = $userAgent -> get($repo_url => $headers); - my $res = $repo_tx -> result or return "Error fetching repositories: " . $repo_tx->error->{message} . "\n"; - - $res->is_success or return "Error fetching repositories: " . $res->message . "\n"; - - my $repo_data = $res -> json; - - last unless @$repo_data; - - push @repos, map { "$org/$_->{name}" } grep { !$_->{archived} } @$repo_data; - - $repo_page++; - } - - return "Error when trying to request information from GitHub, please review the parameters provided." unless @repos; - + my $output = ""; my $total_alerts = 0; my %severity_count = ( @@ -46,32 +21,25 @@ package Sentra::Engine::DependabotMetrics { critical => 0 ); - for my $repo (@repos) { + foreach my $repository (@repositories_list) { my $alert_page = 1; - - while (1) { - my $alert_url = "https://api.github.com/repos/$repo/dependabot/alerts?state=open&per_page=$per_page&page=$alert_page"; - my $alert_tx = $userAgent -> get($alert_url => $headers); - my $res = $alert_tx->result or return "Error fetching alerts for $repo: " . $alert_tx->error->{message} . "\n"; + my $alert_url = "https://api.github.com/repos/$repository/dependabot/alerts?state=open&per_page=$per_page&page=$alert_page"; + my $request = $userAgent -> get($alert_url); - $res->is_success or return "Error fetching alerts for $repo: " . $res->message . "\n"; - - my $alert_data = $res -> json; + if ($request -> code() == 200) { + my $alert_data = decode_json($request -> content()); last unless @$alert_data; - + $total_alerts += scalar @$alert_data; - + for my $alert (@$alert_data) { my $severity = $alert -> {security_vulnerability}{severity} || 'unknown'; + $severity_count{$severity}++ if exists $severity_count{$severity}; - } - - $alert_page++; + } } } - - my $output = ""; $output .= "Severity $_: $severity_count{$_}\n" for keys %severity_count; $output .= "Total DependaBot Alerts: $total_alerts\n"; diff --git a/lib/Sentra/Engine/Maintained.pm b/lib/Sentra/Engine/Maintained.pm index 2e83a52..297cf3a 100644 --- a/lib/Sentra/Engine/Maintained.pm +++ b/lib/Sentra/Engine/Maintained.pm @@ -1,54 +1,37 @@ package Sentra::Engine::Maintained { use strict; use warnings; - use Mojo::UserAgent; - use Mojo::JSON qw(decode_json); + use JSON; use DateTime; use DateTime::Format::ISO8601; + use Sentra::Utils::UserAgent; + use Sentra::Utils::Repositories_List; sub new { my ($class, $org, $token, $per_page) = @_; - my $userAgent = Mojo::UserAgent -> new(); + my $output = ''; + my $userAgent = Sentra::Utils::UserAgent -> new($token); + my @repositories_list = Sentra::Utils::Repositories_List -> new($org, $token); - my $headers = { - 'Authorization' => "Bearer $token", - 'Accept' => 'application/vnd.github+json', - 'X-GitHub-Api-Version' => '2022-11-28' - }; + foreach my $repository (@repositories_list) { + my $get_commits = $userAgent -> get("https://api.github.com/repos/$repository/commits"); - my $output = ''; - my $repo_url = "https://api.github.com/orgs/$org/repos?per_page=$per_page"; - my $repo_tx = $userAgent -> get($repo_url => $headers); - my $res = $repo_tx -> result(); - - if ($res -> is_success) { - my $repos = $res->json; - - for my $repo (@$repos) { - next if $repo -> {archived}; - - my $full_name = "$org/$repo->{name}"; - my $commits_url = "https://api.github.com/repos/$full_name/commits"; - my $commits_tx = $userAgent -> get($commits_url => $headers); - my $commits_res = $commits_tx -> result; - - if ($commits_res && $commits_res->is_success) { - my $commits = $commits_res->json; + if ($get_commits -> code() == 200) { + my $commits = decode_json($get_commits -> content()); - if (@$commits) { - my $last_commit_date_str = $commits->[0]{commit}{committer}{date}; - my $last_commit_date = DateTime::Format::ISO8601 -> parse_datetime($last_commit_date_str); + if (@$commits) { + my $last_commit_date_str = $commits->[0]{commit}{committer}{date}; + my $last_commit_date = DateTime::Format::ISO8601 -> parse_datetime($last_commit_date_str); - if (DateTime -> now -> subtract(days => 90) > $last_commit_date) { - $output .= "The repository https://github.com/$full_name has not been updated for more than 90 days.\n"; - } + if (DateTime -> now -> subtract(days => 90) > $last_commit_date) { + $output .= "The repository https://github.com/$repository has not been updated for more than 90 days.\n"; } - } - } + } + } } - return $output || "No issues found."; + return $output; } } diff --git a/lib/Sentra/Engine/SearchFiles.pm b/lib/Sentra/Engine/SearchFiles.pm index 0603bd0..a9156c5 100644 --- a/lib/Sentra/Engine/SearchFiles.pm +++ b/lib/Sentra/Engine/SearchFiles.pm @@ -1,44 +1,27 @@ package Sentra::Engine::SearchFiles { use strict; use warnings; - use Mojo::UserAgent; - use Mojo::JSON qw(decode_json); + use JSON; + use Sentra::Utils::UserAgent; + use Sentra::Utils::Repositories_List; sub new { my ($class, $org, $token, $per_page) = @_; - my $userAgent = Mojo::UserAgent -> new(); + my $output = ''; + my $userAgent = Sentra::Utils::UserAgent -> new($token); + my @repositories_list = Sentra::Utils::Repositories_List -> new($org, $token); - my $headers = { - 'Authorization' => "Bearer $token", - 'Accept' => 'application/vnd.github+json', - 'X-GitHub-Api-Version' => '2022-11-28' - }; - - my $output = ''; - my $repo_url = "https://api.github.com/orgs/$org/repos?per_page=$per_page"; - my $repo_tx = $userAgent -> get($repo_url => $headers); - - my $res = $repo_tx -> result(); - - if ($res -> is_success) { - my $repos = $res -> json(); - - for my $repo (@$repos) { - next if $repo -> {archived}; - - my $full_name = "$org/$repo->{name}"; - - my $dependabot_url = "https://api.github.com/repos/$full_name/contents/.github/dependabot.yaml"; - my $dependabot_tx = $userAgent -> get($dependabot_url => $headers); + foreach my $repository (@repositories_list) { + my $dependabot_url = "https://api.github.com/repos/$repository/contents/.github/dependabot.yaml"; + my $request = $userAgent -> get($dependabot_url); - if ($dependabot_tx -> result -> code == 404) { - $output .= "The dependabot.yml file was not found in this repository: https://github.com/$full_name\n"; - } - } + if ($request -> code == 404) { + $output .= "The dependabot.yml file was not found in this repository: https://github.com/$repository\n"; + } } - return $output || "No issues found."; + return $output; } } diff --git a/lib/Sentra/Utils/Github.pm b/lib/Sentra/Utils/Github.pm deleted file mode 100644 index d10a473..0000000 --- a/lib/Sentra/Utils/Github.pm +++ /dev/null @@ -1,10 +0,0 @@ -package Sentra::Utils::Github { - use strict; - use warnings; - - sub new { - return 1; - } -} - -1; \ No newline at end of file diff --git a/sentra.pl b/sentra.pl index c8e5d86..350e0a7 100644 --- a/sentra.pl +++ b/sentra.pl @@ -28,9 +28,9 @@ sub main { ); my %dispatch_table = ( - 'metrics' => sub { Sentra::Engine::DependabotMetrics->new($org, $token, $per_page) }, - 'dependency' => sub { Sentra::Engine::SearchFiles->new($org, $token, $per_page) }, - 'maintained' => sub { Sentra::Engine::Maintained->new($org, $token, $per_page) }, + 'metrics' => sub { Sentra::Engine::DependabotMetrics -> new($org, $token, $per_page) }, + 'dependency' => sub { Sentra::Engine::SearchFiles -> new($org, $token, $per_page) }, + 'maintained' => sub { Sentra::Engine::Maintained -> new($org, $token, $per_page) }, ); for my $option (keys %options) {