From 523d6df5b880f71eafd24085959b1523197f9f07 Mon Sep 17 00:00:00 2001 From: Drew Hess Date: Mon, 26 Apr 2021 01:38:24 +0100 Subject: [PATCH] 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. --- src/lib/Hydra/Plugin/GithubStatus.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/Hydra/Plugin/GithubStatus.pm b/src/lib/Hydra/Plugin/GithubStatus.pm index e2e4d8ed..7d58c098 100644 --- a/src/lib/Hydra/Plugin/GithubStatus.pm +++ b/src/lib/Hydra/Plugin/GithubStatus.pm @@ -93,8 +93,11 @@ sub common { if (defined $eval->flake) { my $fl = $eval->flake; print STDERR "Flake is $fl\n"; - $eval->flake =~ m!github:([^/]+)/([^/]+)/(.+)$!; - $sendStatus->("src", $1, $2, $3); + if ($eval->flake =~ m!github:([^/]+)/([^/]+)/([[:xdigit:]]{40})$! or $eval->flake =~ m!git\+ssh://git\@github.com/([^/]+)/([^/]+)\?.*rev=([[:xdigit:]]{40})$!) { + $sendStatus->("src", $1, $2, $3); + } else { + print STDERR "Can't parse flake, skipping GitHub status update\n"; + } } else { foreach my $input (@inputs) { my $i = $eval->jobsetevalinputs->find({ name => $input, altnr => 0 });