-
Notifications
You must be signed in to change notification settings - Fork 43
chore(cla): Contributor License Agreement, CLA gate, and layered licensing #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,96 @@ | ||
| name: CLA Assistant | ||
|
|
||
| # Gates every pull request on the Contributor License Agreement (CLA.md). | ||
| # A contributor who has not signed is asked to comment the sign phrase once; | ||
| # their signature is recorded in the private Mes-Open/cla-signatures repo and the | ||
| # check turns green. The owner's accounts, org members and bots are allow-listed | ||
| # and never asked. See docs/cla/SETUP.md for the one-time setup (PAT + repo). | ||
| on: | ||
| issue_comment: | ||
| types: [created] | ||
| pull_request_target: | ||
| types: [opened, synchronize, closed] | ||
|
|
||
| permissions: | ||
| actions: write | ||
| contents: write | ||
| issues: write | ||
| pull-requests: write | ||
| statuses: write | ||
|
|
||
| jobs: | ||
| cla: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: CLA Assistant | ||
| id: cla | ||
| # continue-on-error so the label steps below can run even when the CLA is | ||
| # not yet satisfied; the final step re-fails the job to keep the required | ||
| # "CLA Assistant" check red until everyone has signed. | ||
| continue-on-error: true | ||
| if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target' | ||
| # Pinned to the exact commit of v2.6.1 (the action's repo is archived; | ||
| # pinning to a SHA removes the moving-tag supply-chain risk). | ||
| uses: contributor-assistant/github-action@ca4a40a7d1004f18d9960b404b97e5f30a505a08 # v2.6.1 | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| # Fine-grained PAT with contents:write on Mes-Open/cla-signatures. | ||
| PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_SIGNATURES_PAT }} | ||
| with: | ||
| path-to-signatures: 'signatures/version1/cla.json' | ||
| path-to-document: 'https://github.com/Mes-Open/OpenMes/blob/main/CLA.md' | ||
| branch: 'main' | ||
| remote-organization-name: 'Mes-Open' | ||
| remote-repository-name: 'cla-signatures' | ||
| # Only the owner's own accounts and bots are exempt. Org members | ||
| # (Svannte / Mateusz Łuczyński, JanKolo04 / Jan Kołodziej, ElNinio978) | ||
| # are intentionally NOT allow-listed — they sign via the bot too; their | ||
| # ICLA then operates on behalf of and with the company's consent (CLA §C4). | ||
| allowlist: 'jakub-przepiora,jakubprzepiora-cyber,dependabot[bot],github-actions[bot],renovate[bot]' | ||
| create-file-commit-message: 'chore: create CLA signatures file' | ||
| signed-commit-message: 'chore: $contributorName has signed the CLA in $owner/$repo#$pullRequestNo' | ||
| custom-notsigned-prcomment: | | ||
| Thank you for your pull request to OpenMES! / Dziękujemy za pull request do OpenMES! | ||
|
|
||
| Before we can merge it, please sign our Contributor License Agreement — read it in | ||
| [CLA.md](https://github.com/Mes-Open/OpenMes/blob/main/CLA.md). You keep the copyright to your | ||
| work; the CLA only grants the project the rights needed to keep OpenMES open source **and** offer | ||
| it under additional (commercial) licenses. | ||
|
|
||
| Zanim scalimy PR, prosimy o podpisanie CLA (treść w [CLA.md](https://github.com/Mes-Open/OpenMes/blob/main/CLA.md)). | ||
| Zachowujesz prawa autorskie do swojego kodu. | ||
|
|
||
| To sign, post a comment with exactly the following text / Aby podpisać, wklej komentarz o treści: | ||
| custom-pr-sign-comment: 'I have read the CLA Document and I hereby sign the CLA' | ||
| custom-allsigned-prcomment: 'All contributors have signed the CLA. Thank you! / Wszyscy autorzy podpisali CLA. Dziękujemy!' | ||
| lock-pullrequest-aftermerge: false | ||
|
|
||
| # Gate CodeRabbit on the CLA: add the `cla-signed` label once the CLA step | ||
| # passed (all authors signed / allow-listed), remove it otherwise. CodeRabbit | ||
| # (.coderabbit.yaml) only auto-reviews PRs carrying this label — so review | ||
| # happens only after signing. This is a convenience gate; the hard merge | ||
| # block is the required "CLA Assistant" status check below. | ||
| - name: Sync cla-signed label | ||
| if: always() && (steps.cla.outcome == 'success' || steps.cla.outcome == 'failure') | ||
| uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | ||
| with: | ||
| script: | | ||
| const pr = context.payload.pull_request ?? context.payload.issue; | ||
| // Only act on PRs (an issue_comment on a plain issue has no pull_request). | ||
| if (!pr || (context.payload.issue && !context.payload.issue.pull_request)) return; | ||
| const label = 'cla-signed'; | ||
| const params = { owner: context.repo.owner, repo: context.repo.repo, issue_number: pr.number }; | ||
| if ('${{ steps.cla.outcome }}' === 'success') { | ||
| await github.rest.issues.addLabels({ ...params, labels: [label] }); | ||
| } else { | ||
| try { | ||
| await github.rest.issues.removeLabel({ ...params, name: label }); | ||
| } catch (e) { | ||
| if (e.status !== 404) throw e; // label wasn't set — fine | ||
| } | ||
| } | ||
|
|
||
| # Preserve the red required check when the CLA is not yet satisfied. | ||
| - name: Propagate CLA status | ||
| if: always() && steps.cla.outcome == 'failure' | ||
| run: exit 1 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
Prevent stale runs from restoring
cla-signed.A signing-comment run and a later
synchronizerun can overlap. An older successful run can execute this branch after a newer unsigned commit's failed run removes the label. CodeRabbit can then review the current unsigned pull request. Serialize runs per pull request or re-check the current head and CLA state before adding the label.🤖 Prompt for AI Agents