Skip to content

Commit 8b61385

Browse files
rowan-claudeclaude
andcommitted
Add the Contributor Assignment Agreement (CAA) gate: PRs require signing before merge.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent cb62a52 commit 8b61385

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

.github/workflows/cla.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# .github/workflows/cla.yml -- goes in EACH library repo.
2+
# Blocks a PR from merging until every human commit-author has signed the
3+
# Contributor Assignment Agreement (CAA). Signatures are recorded per GitHub
4+
# user in one central file, so a person signs once and it counts everywhere.
5+
#
6+
# Contributors sign by posting this exact comment on their PR:
7+
# I have read the CAA and I hereby sign it, assigning copyright in my
8+
# contributions to Más Bandwidth LLC.
9+
#
10+
# REQUIRES a repo or org secret named CLA_SIGNATURES_TOKEN (a fine-grained or
11+
# classic PAT with contents + pull-requests write on the library repos and on
12+
# mas-bandwidth/.github). The built-in GITHUB_TOKEN is read-only for pull
13+
# requests from forks, which is exactly the case we need to gate, so the PAT is
14+
# required. Do not commit the token, add it in repo/org Settings -> Secrets.
15+
16+
name: Contributor Assignment Agreement
17+
on:
18+
issue_comment:
19+
types: [created]
20+
pull_request_target:
21+
types: [opened, synchronize]
22+
23+
permissions:
24+
actions: write
25+
contents: read
26+
pull-requests: write
27+
statuses: write
28+
29+
jobs:
30+
caa:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: CAA check
34+
if: (github.event.comment.body == 'I have read the CAA and I hereby sign it, assigning copyright in my contributions to Más Bandwidth LLC.') || github.event_name == 'pull_request_target'
35+
uses: contributor-assistant/github-action@v2.6.1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
PERSONAL_ACCESS_TOKEN: ${{ secrets.CLA_SIGNATURES_TOKEN }}
39+
with:
40+
# one central signature store for the whole org -> per-user tracking
41+
remote-organization-name: mas-bandwidth
42+
remote-repository-name: .github
43+
branch: cla-signatures
44+
path-to-signatures: signatures/caa.json
45+
path-to-document: https://github.com/mas-bandwidth/.github/blob/main/CAA.md
46+
# our own accounts and bots never need to sign
47+
allowlist: gafferongames,rowan-claude,*[bot]
48+
custom-notsigned-prcomment: 'Thanks for the contribution. Before it can be merged, please read the [Contributor Assignment Agreement](https://github.com/mas-bandwidth/.github/blob/main/CAA.md) and sign it by posting the exact sentence below as a comment on this PR.'
49+
custom-pr-sign-comment: 'I have read the CAA and I hereby sign it, assigning copyright in my contributions to Más Bandwidth LLC.'
50+
custom-allsigned-prcomment: 'All contributors have signed the CAA. Thank you.'
51+
lock-pullrequest-aftermerge: false

0 commit comments

Comments
 (0)