Skip to content

Commit

Permalink
(travis) Do not run the git authorship check within a github PR
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ribasushi committed Nov 4, 2015
1 parent 554484c commit 606ff39
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions xt/dist/authors.t
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,29 @@ if (length $ENV{PATH}) {
) =~ /\A(.+)\z/;
}

# this may fail - not every system has git
if (my @git_authors = map
{ my ($gitname) = m/^ \s* \d+ \s* (.+?) \s* $/mx; utf8::decode($gitname); $gitname }
qx( git shortlog -e -s )
# no git-check when smoking a PR
if (
(
! $ENV{TRAVIS_PULL_REQUEST}
or
$ENV{TRAVIS_PULL_REQUEST} eq "false"
)
and
-d '.git'
) {
for (@git_authors) {

binmode (Test::More->builder->$_, ':utf8') for qw/output failure_output todo_output/;

# this may fail - not every system has git
for (
map
{ my ($gitname) = m/^ \s* \d+ \s* (.+?) \s* $/mx; utf8::decode($gitname); $gitname }
qx( git shortlog -e -s )
) {
my ($eml) = $_ =~ $email_re;

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

Expand Down

0 comments on commit 606ff39

Please sign in to comment.