From 5a4f88f51ae89a6c4627494349b2c909924b7d32 Mon Sep 17 00:00:00 2001 From: yi-ge Date: Fri, 8 May 2026 17:18:02 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=20CLA=20+=20PR=20?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=20+=20cla-check=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CLA.md:与主仓库 desirecore/desirecore 一致的贡献者许可协议 - .github/PULL_REQUEST_TEMPLATE.md:含 CLA 勾选项(链接指向本仓库 CLA.md) - .github/workflows/cla.yml:PR 上自动检查贡献者是否勾选 CLA(机器人/内部成员自动跳过) Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/PULL_REQUEST_TEMPLATE.md | 11 ++++++++ .github/workflows/cla.yml | 47 ++++++++++++++++++++++++++++++++ CLA.md | 47 ++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/cla.yml create mode 100644 CLA.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..f17a282 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,11 @@ +## 变更说明 / Description + + + +## 测试方式 / Test Plan + + + +## 检查清单 / Checklist + +- [ ] 我已阅读并同意 [贡献者许可协议 (CLA)](https://github.com/desirecore/docs/blob/main/CLA.md) / I have read and agree to the [Contributor License Agreement (CLA)](https://github.com/desirecore/docs/blob/main/CLA.md) diff --git a/.github/workflows/cla.yml b/.github/workflows/cla.yml new file mode 100644 index 0000000..0734d7f --- /dev/null +++ b/.github/workflows/cla.yml @@ -0,0 +1,47 @@ +name: "CLA Check" +on: + pull_request_target: + types: [opened, edited, synchronize] + +permissions: + pull-requests: read + +jobs: + cla-check: + runs-on: ubuntu-latest + steps: + - name: Check CLA agreement + uses: actions/github-script@v7 + with: + script: | + const pr = context.payload.pull_request; + + // Skip bot accounts + const botList = ['dependabot[bot]', 'renovate[bot]', 'github-actions[bot]']; + if (botList.includes(pr.user.login)) { + console.log(`Skipping CLA check for bot: ${pr.user.login}`); + return; + } + + // Skip internal contributors (org owners, members, collaborators). + // CLA is only required for external contributors (CONTRIBUTOR / FIRST_TIME_CONTRIBUTOR / FIRST_TIMER / NONE). + const internalAssociations = ['OWNER', 'MEMBER', 'COLLABORATOR']; + if (internalAssociations.includes(pr.author_association)) { + console.log(`Skipping CLA check for internal contributor: ${pr.user.login} (${pr.author_association})`); + return; + } + + const body = pr.body || ''; + const claChecked = + body.includes('[x] 我已阅读并同意 [贡献者许可协议 (CLA)]') || + body.includes('[x] I have read and agree to the [Contributor License Agreement (CLA)]'); + + if (!claChecked) { + core.setFailed( + '❌ CLA 检查未通过 / CLA check failed\n\n' + + '请在 PR 描述中勾选「我已阅读并同意贡献者许可协议 (CLA)」后再提交。\n' + + 'Please check the "I have read and agree to the Contributor License Agreement (CLA)" checkbox in the PR description before submitting.\n\n' + + '如果 PR 描述中没有该选项,请使用仓库的 PR 模板重新创建。\n' + + 'If the checkbox is missing, please recreate the PR using the repository PR template.' + ); + } diff --git a/CLA.md b/CLA.md new file mode 100644 index 0000000..c8a6c4c --- /dev/null +++ b/CLA.md @@ -0,0 +1,47 @@ +# Contributor License Agreement (CLA) + +## 贡献者许可协议 + +感谢你对 DesireCore 的贡献!为了确保项目能够在当前及未来的许可模式下持续运营, +所有向本项目提交 Pull Request 的贡献者需同意以下条款。 + +**提交 Pull Request 即视为同意本协议。** + +--- + +### 1. 权利授予 + +你在此不可撤销地授予 **云南日冕科技有限公司**(Yunnan Solar Corona Technology Co., Ltd.) +及其继承人和受让人,对你提交的全部贡献内容(包括代码、文档、设计及其他材料): + +- 使用、复制、修改、展示、分发、再许可及以其他方式利用的永久性、全球性、免版税、 + 非独占的权利 +- 将贡献内容纳入本项目任意版本并以任意许可模式发布的权利(包括但不限于项目当前 + LICENSE 文件中定义的 Part A、Part B、Part C 三种许可) +- 将贡献内容用于商业用途的权利 + +### 2. 原创声明 + +你声明并保证: + +- 你提交的贡献是你的原创作品,或者你拥有授予上述权利的合法权限 +- 你的贡献不侵犯任何第三方的知识产权、专利权、商标权或其他权利 +- 如果你的贡献包含受雇期间创作的内容,你已获得雇主的书面许可 + +### 3. 道德权利 + +在适用法律允许的范围内,你同意不对贡献内容主张道德权利(moral rights), +或同意不以阻碍本项目合理使用的方式行使该等权利。 + +### 4. 无义务 + +本项目维护者没有义务接受或合并你的贡献。接受贡献不构成雇佣关系或任何其他法律关系。 + +### 5. 后续许可变更 + +你理解并同意,本项目的许可模式可能随版本迭代而变化(如 LICENSE 文件中描述的 +版本流转机制),你授予的权利覆盖这些变化。 + +### 6. 适用法律 + +本协议受中华人民共和国法律管辖。