Fix GitHub status update for private flakes.

Also, if the parse fails, don't try to update the GitHub status, as
this will eventually cause rate-limiting.
This commit is contained in:
Drew Hess 2021-04-26 01:38:24 +01:00
parent 85e299d3d7
commit 523d6df5b8
No known key found for this signature in database
GPG key ID: 4DC0BBFBE3FEF428

View file

@ -93,8 +93,11 @@ sub common {
if (defined $eval->flake) { if (defined $eval->flake) {
my $fl = $eval->flake; my $fl = $eval->flake;
print STDERR "Flake is $fl\n"; print STDERR "Flake is $fl\n";
$eval->flake =~ m!github:([^/]+)/([^/]+)/(.+)$!; if ($eval->flake =~ m!github:([^/]+)/([^/]+)/([[:xdigit:]]{40})$! or $eval->flake =~ m!git\+ssh://git\@github.com/([^/]+)/([^/]+)\?.*rev=([[:xdigit:]]{40})$!) {
$sendStatus->("src", $1, $2, $3); $sendStatus->("src", $1, $2, $3);
} else {
print STDERR "Can't parse flake, skipping GitHub status update\n";
}
} else { } else {
foreach my $input (@inputs) { foreach my $input (@inputs) {
my $i = $eval->jobsetevalinputs->find({ name => $input, altnr => 0 }); my $i = $eval->jobsetevalinputs->find({ name => $input, altnr => 0 });