mirror of https://github.com/docker/docs.git
Update the Travis GitHub username regex to match the GitHub username requirements
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
This commit is contained in:
parent
323e6a3cf2
commit
e895817ad7
|
@ -9,13 +9,22 @@ notDocs="$(validate_diff --numstat | awk '$3 !~ /^docs\// { print $3 }')"
|
||||||
: ${adds:=0}
|
: ${adds:=0}
|
||||||
: ${dels:=0}
|
: ${dels:=0}
|
||||||
|
|
||||||
|
# "Username may only contain alphanumeric characters or dashes and cannot begin with a dash"
|
||||||
|
githubUsernameRegex='[a-zA-Z][a-zA-Z-]+'
|
||||||
|
|
||||||
|
# https://github.com/dotcloud/docker/blob/master/CONTRIBUTING.md#sign-your-work
|
||||||
|
dcoPrefix='Docker-DCO-1.1-Signed-off-by:'
|
||||||
|
dcoRegex="^$dcoPrefix ([^<]+) <([^<>@]+@[^<>]+)> \\(github: ($githubUsernameRegex)\\)$"
|
||||||
|
|
||||||
|
check_dco() {
|
||||||
|
grep -qE "$dcoRegex"
|
||||||
|
}
|
||||||
|
|
||||||
if [ $adds -eq 0 -a $dels -eq 0 ]; then
|
if [ $adds -eq 0 -a $dels -eq 0 ]; then
|
||||||
echo '0 adds, 0 deletions; nothing to validate! :)'
|
echo '0 adds, 0 deletions; nothing to validate! :)'
|
||||||
elif [ -z "$notDocs" -a $adds -le 1 -a $dels -le 1 ]; then
|
elif [ -z "$notDocs" -a $adds -le 1 -a $dels -le 1 ]; then
|
||||||
echo 'Congratulations! DCO small-patch-exception material!'
|
echo 'Congratulations! DCO small-patch-exception material!'
|
||||||
else
|
else
|
||||||
dcoPrefix='Docker-DCO-1.1-Signed-off-by:'
|
|
||||||
dcoRegex="^$dcoPrefix ([^<]+) <([^<>@]+@[^<>]+)> \\(github: (\S+)\\)$"
|
|
||||||
commits=( $(validate_log --format='format:%H%n') )
|
commits=( $(validate_log --format='format:%H%n') )
|
||||||
badCommits=()
|
badCommits=()
|
||||||
for commit in "${commits[@]}"; do
|
for commit in "${commits[@]}"; do
|
||||||
|
@ -23,7 +32,7 @@ else
|
||||||
# no content (ie, Merge commit, etc)
|
# no content (ie, Merge commit, etc)
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
if ! git log -1 --format='format:%B' "$commit" | grep -qE "$dcoRegex"; then
|
if ! git log -1 --format='format:%B' "$commit" | check_dco; then
|
||||||
badCommits+=( "$commit" )
|
badCommits+=( "$commit" )
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in New Issue