diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..377d6231d --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ + + + + +--- + +### Contributor License Agreement + + + +By submitting this pull request, I agree to dual-license this contribution under both BSD 3-clause and Apache License, Version 2.0. + +- [ ] **I agree to dual-license this contribution under both BSD 3-clause and Apache License, Version 2.0.** diff --git a/.github/workflows/pr-license.yml b/.github/workflows/pr-license.yml new file mode 100644 index 000000000..b2487db26 --- /dev/null +++ b/.github/workflows/pr-license.yml @@ -0,0 +1,24 @@ +name: CLA Check + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +permissions: + pull-requests: read + +jobs: + enforce-cla: + runs-on: ubuntu-latest + steps: + - name: Dual-License Agreement + env: + PR_BODY: ${{ github.event.pull_request.body }} + run: | + # Use a regex match to look for the exact checked markdown box + if echo "$PR_BODY" | grep -qE '\-\s*\[x\]\s*\*?\*?I agree to dual\-license this contribution under both BSD 3\-clause and Apache License, Version 2\.0\.'; then + echo "CLA OK" + else + echo "You must check the dual-licensing agreement box in the PR description to pass this check." + exit 1 + fi diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ae7308cf1..05add6fd2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,6 +5,16 @@ We take pull requests! All pull requests are thoroughly reviewed for code quality. +## Licensing + +The "outbound" license of this repository as a whole remains BSD 3-clause, as was set up at repository creation. +New code ("inbound") is required to be dual-licensed under both BSD 3-clause and Apache License, Version 2.0. +This requirement is so new contributions can be used with a more modern license without messy relicensing of older code. + +By contributing to this project, you agree to dual-license your contributions under both BSD 3-clause and Apache License, Version 2.0. +The pull request template includes text to confirm this. + + ## Parts Contributions This repository maintains a curated parts library since: