Skip to content

Commit 78ed8d7

Browse files
authored
Merge pull request #1533 from hacker1024/patch-3
GithubRefs: Allow arbitrary ref types
2 parents 0414ae6 + d7b40c4 commit 78ed8d7

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/lib/Hydra/Plugin/GithubRefs.pm

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ tags) from GitHub following a certain naming scheme
1818
1919
=head1 DESCRIPTION
2020
21-
This plugin reads the list of branches or tags using GitHub's REST API. The name
22-
of the reference must follow a particular prefix. This list is stored in the
23-
nix-store and used as an input to declarative jobsets.
21+
This plugin reads the list of branches or tags using GitHub's REST API. This
22+
list is stored in the nix-store and used as an input to declarative jobsets.
2423
2524
=head1 CONFIGURATION
2625
@@ -34,20 +33,19 @@ The declarative project C<spec.json> file must contains an input such as
3433
3534
"pulls": {
3635
"type": "github_refs",
37-
"value": "[owner] [repo] heads|tags - [prefix]",
36+
"value": "[owner] [repo] [type] - [prefix]",
3837
"emailresponsible": false
3938
}
4039
4140
In the above snippet, C<[owner]> is the repository owner and C<[repo]> is the
4241
repository name. Also note a literal C<->, which is placed there for the future
4342
use.
4443
45-
C<heads|tags> denotes that one of these two is allowed, that is, the third
46-
position should hold either the C<heads> or the C<tags> keyword. In case of the former, the plugin
47-
will fetch all branches, while in case of the latter, it will fetch the tags.
44+
C<[type]> is the type of ref to list. Typical values are "heads", "tags", and
45+
"pull". "." will include all types.
4846
4947
C<prefix> denotes the prefix the reference name must start with, in order to be
50-
included.
48+
included. "." will include all references.
5149
5250
For example, C<"value": "nixos hydra heads - release/"> refers to
5351
L<https://github.com/nixos/hydra> repository, and will fetch all branches that
@@ -102,8 +100,6 @@ sub fetchInput {
102100
return undef if $input_type ne "github_refs";
103101

104102
my ($owner, $repo, $type, $fut, $prefix) = split ' ', $value;
105-
die "type field is neither 'heads' nor 'tags', but '$type'"
106-
unless $type eq 'heads' or $type eq 'tags';
107103

108104
my $auth = $self->{config}->{github_authorization}->{$owner};
109105
my $githubEndpoint = $self->{config}->{github_endpoint} // "https://api.github.com";

0 commit comments

Comments
 (0)