Skip to content

Commit 606ff39

Browse files
committed
(travis) Do not run the git authorship check within a github PR
Before running the CI test github "helpfully" generates a merge-commit, which uses the email as listed in the github profile, NOT using the email/name as seen on the merged commit itself. This can cause the entire thing to fail for no apparent reason Since any PR is scrutinized and tested to bits after the fact - skipping the test is safe Read under -w
1 parent 554484c commit 606ff39

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

xt/dist/authors.t

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,29 @@ if (length $ENV{PATH}) {
5858
) =~ /\A(.+)\z/;
5959
}
6060

61-
# this may fail - not every system has git
62-
if (my @git_authors = map
63-
{ my ($gitname) = m/^ \s* \d+ \s* (.+?) \s* $/mx; utf8::decode($gitname); $gitname }
64-
qx( git shortlog -e -s )
61+
# no git-check when smoking a PR
62+
if (
63+
(
64+
! $ENV{TRAVIS_PULL_REQUEST}
65+
or
66+
$ENV{TRAVIS_PULL_REQUEST} eq "false"
67+
)
68+
and
69+
-d '.git'
6570
) {
66-
for (@git_authors) {
71+
72+
binmode (Test::More->builder->$_, ':utf8') for qw/output failure_output todo_output/;
73+
74+
# this may fail - not every system has git
75+
for (
76+
map
77+
{ my ($gitname) = m/^ \s* \d+ \s* (.+?) \s* $/mx; utf8::decode($gitname); $gitname }
78+
qx( git shortlog -e -s )
79+
) {
6780
my ($eml) = $_ =~ $email_re;
6881

69-
fail "Commit author '$_' (from git) not reflected in AUTHORS, perhaps a missing .mailmap entry?"
70-
unless $known_authors{$eml};
82+
ok $known_authors{$eml},
83+
"Commit author '$_' (from .mailmap-aware `git shortlog -e -s`) reflected in ./AUTHORS";
7184
}
7285
}
7386

0 commit comments

Comments
 (0)