Skip to content

Commit 6e954b2

Browse files
authored
Add license and script checking that CLA has been signed (#14)
Add script checking that contributors have signed the Scala CLA Add BSD-3-Clause license file
1 parent 41243aa commit 6e954b2

File tree

3 files changed

+52
-2
lines changed

3 files changed

+52
-2
lines changed

.travis.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# - oracle-java8-installer
66
language: scala
77
jdk:
8-
- oraclejdk8
8+
- oraclejdk8
9+
before_script:
10+
- ./checkCLA.sh
911
script:
10-
- sbt +test
12+
- sbt +test

LICENSE

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Copyright (c) 2002-2018 EPFL
2+
Copyright (c) 2011-2018 Lightbend, Inc.
3+
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without modification,
7+
are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice,
10+
this list of conditions and the following disclaimer.
11+
* Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
14+
* Neither the name of the EPFL nor the names of its contributors
15+
may be used to endorse or promote products derived from this software
16+
without specific prior written permission.
17+
18+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
22+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

checkCLA.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
# Script copied from https://github.com/scalameta/scalameta
3+
set -e
4+
5+
if [ "$TRAVIS_PULL_REQUEST" != "false" ] ; then
6+
echo "Incoming pull request from https://github.com/$TRAVIS_REPO_SLUG/pull/$TRAVIS_PULL_REQUEST";
7+
author=$(curl -u dummy4dummy:dummy2dummy -s "https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST" | jq -r ".user.login");
8+
if [ $? -ne 0 ] ; then exit 1; fi;
9+
echo "Pull request submitted by $author";
10+
signed=$(curl -s https://www.lightbend.com/contribute/cla/scala/check/$author | jq -r ".signed");
11+
if [ $? -ne 0 ] ; then exit 1; fi;
12+
if [ "$signed" = "true" ] ; then
13+
echo "CLA check for $author successful";
14+
else
15+
echo "CLA check for $author failed";
16+
echo "Please sign the Scala CLA to contribute to $TRAVIS_REPO_SLUG";
17+
echo "Go to https://www.lightbend.com/contribute/cla/scala and then resubmit this pull request";
18+
exit 1;
19+
fi;
20+
fi;

0 commit comments

Comments
 (0)