diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml new file mode 100644 index 0000000..1547a05 --- /dev/null +++ b/.github/workflows/cla.yml @@ -0,0 +1,8 @@ +name: Scala CLA +on: [pull_request] +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - run: ./project/scripts/check-cla.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7d6f563..f8e081c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,8 @@ This document explains the developer workflow for making changes to the [Scala Syntax (official) extension](https://marketplace.visualstudio.com/items?itemName=scala-lang.scala) for Visual Studio Code. +To contribute, make sure you have signed the [Scala CLA](http://typesafe.com/contribute/cla/scala), if not, please sign it. + ## Prerequisites Make sure you have the following binaries installed: diff --git a/project/scripts/check-cla.sh b/project/scripts/check-cla.sh new file mode 100755 index 0000000..8538a27 --- /dev/null +++ b/project/scripts/check-cla.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -eux + +AUTHOR=$GITHUB_ACTOR +echo "Pull request submitted by $AUTHOR"; +signed=$(curl -s https://www.lightbend.com/contribute/cla/scala/check/$AUTHOR | jq -r ".signed"); +if [ "$signed" = "true" ] ; then + echo "CLA check for $AUTHOR successful"; +else + echo "CLA check for $AUTHOR failed"; + echo "Please sign the Scala CLA to contribute to the Scala compiler."; + echo "Go to https://www.lightbend.com/contribute/cla/scala and then"; + echo "comment on the pull request to ask for a new check."; + echo ""; + echo "Check if CLA is signed: https://www.lightbend.com/contribute/cla/scala/check/$AUTHOR"; + exit 1; +fi;