Skip to content

Commit

Permalink
Merge branch 'master' of github.com:perl6/ecosystem-unbitrot
Browse files Browse the repository at this point in the history
  • Loading branch information
JJ committed Feb 8, 2019
2 parents b73e32e + 9be04c4 commit 8f42048
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
6 changes: 4 additions & 2 deletions bin/update-issues.p6
Expand Up @@ -14,6 +14,8 @@ unit sub MAIN(
my %modules = from-json slurp $blin-data;
my @issues = get-issues :$token;
my $template-text = slurp $template;
my $module-metadata = fetch https://modules.perl6.org/search.json;


for @issues -> $issue {
.<ticket> = $issue with %modules{$issue<title>};
Expand All @@ -38,9 +40,9 @@ for %modules.keys.sort -> $name {
my $previous-ticket = $ticket ?? Preivous ticket: # ~ $ticket<number> !! ;

$body .= subst: 「MODULE」, $name;
$body .= subst: 「MODULE-URL」, https://modules.perl6.org/dist/$module;
$body .= subst: 「MODULE-URL」, https://modules.perl6.org/dist/$name;
$body .= subst: 「BLIN-STATUS」, $module<status>;
$body .= subst: 「OUTPUT」, $module<output>;
$body .= subst: 「OUTPUT」, $module<output> || No output;
$body .= subst: 「PING-AUTHOR」, $ping-author;
$body .= subst: 「PREVIOUS-TICKET」, $previous-ticket;

Expand Down
16 changes: 13 additions & 3 deletions lib/Unbitrot/Utils.pm6
Expand Up @@ -4,9 +4,19 @@ unit module Unbitrot::Utils;

use Cro::HTTP::Client;

my $repo = perl6/ecosystem-unbitrot;
constant \issues-url = https://api.github.com/repos/$repo/issues?per_page=60&direction=asc&state=all;
constant \submit-url = https://api.github.com/repos/$repo/issues;
constant repo = perl6/ecosystem-unbitrot;
constant \issues-url = https://api.github.com/repos/{repo}/issues?per_page=60&direction=asc&state=all;
constant \submit-url = https://api.github.com/repos/{repo}/issues;

#| Fetches a url
sub fetch($url) is export {
my $resp = await Cro::HTTP::Client.get: $url,
headers => [
User-Agent => perl6 ecosystem unbitrot,
],
;
return await $resp.body
}

#| Returns all issues from the repo
sub get-issues(:$token, :$url = issues-url) is export {
Expand Down

0 comments on commit 8f42048

Please sign in to comment.