Skip to content

Commit 63c96ba

Browse files
Merge pull request #25 from zoxilsi/master
2 parents 0301342 + d4062e1 commit 63c96ba

File tree

6 files changed

+365
-154
lines changed

6 files changed

+365
-154
lines changed

.github/DCO.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Developer Certificate of Origin (DCO)
2+
3+
## What is DCO?
4+
5+
The Developer Certificate of Origin (DCO) is a lightweight way for contributors to certify that they wrote or otherwise have the right to submit the code they are contributing to the project.
6+
7+
## How to Sign Off Your Commits
8+
9+
### For New Commits
10+
Use the `-s` flag when committing:
11+
```bash
12+
git commit -s -m "your commit message"
13+
```
14+
15+
### For Existing Commits
16+
17+
#### Single Commit
18+
```bash
19+
git commit --amend -s
20+
```
21+
22+
#### Multiple Commits
23+
```bash
24+
# For the last n commits
25+
git rebase --signoff HEAD~n
26+
27+
# For all commits in your branch
28+
git rebase --signoff main
29+
```
30+
31+
### Manual Sign-off
32+
Add this line to your commit message:
33+
```
34+
Signed-off-by: Your Name <[email protected]>
35+
```
36+
37+
## DCO Text
38+
39+
By making a contribution to this project, I certify that:
40+
41+
1. The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or
42+
43+
2. The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or
44+
45+
3. The contribution was provided directly to me by some other person who certified (1), (2) or (3) and I have not modified it.
46+
47+
4. I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved.
48+
49+
## Troubleshooting
50+
51+
### Check if commits are signed
52+
```bash
53+
git log --show-signature
54+
```
55+
56+
### Configure git for automatic sign-off
57+
```bash
58+
git config --global user.name "Your Name"
59+
git config --global user.email "[email protected]"
60+
```
61+
62+
### Create an alias for signed commits
63+
```bash
64+
git config --global alias.cs 'commit -s'
65+
```
66+
67+
Then use `git cs -m "message"` instead of `git commit -s -m "message"`.
68+
69+
## Why DCO?
70+
71+
- **Legal Protection**: Provides legal protection for both contributors and maintainers
72+
- **Simple Process**: Lightweight alternative to Contributor License Agreements (CLAs)
73+
- **Transparency**: Creates a clear audit trail of contributions
74+
- **Industry Standard**: Used by major projects like Linux kernel, Docker, and many CNCF projects

.github/workflows/commitlint.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Commitlint
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
branches: [ master, main ]
7+
8+
jobs:
9+
commitlint:
10+
runs-on: ubuntu-latest
11+
name: Check commit messages
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '18'
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
run: |
26+
npm install --no-save @commitlint/config-conventional @commitlint/cli
27+
28+
- name: Validate PR commits with commitlint
29+
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

.github/workflows/dco.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Developer Certificate of Origin (DCO) Check
2+
# This workflow ensures all commits are signed off according to DCO requirements
3+
# DCO helps establish a clear chain of custody for contributions
4+
5+
name: DCO Check
6+
7+
on:
8+
pull_request:
9+
# Only run on relevant PR events to save CI resources
10+
types: [opened, synchronize, reopened]
11+
# Target branches where DCO compliance is required
12+
branches: [ master, main ]
13+
14+
jobs:
15+
dco-check:
16+
runs-on: ubuntu-latest
17+
name: Developer Certificate of Origin Check
18+
19+
# Add timeout to prevent hanging workflows
20+
timeout-minutes: 5
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v4
25+
with:
26+
# Fetch full history to check all commits in PR
27+
fetch-depth: 0
28+
# Use token for private repos if needed
29+
token: ${{ secrets.GITHUB_TOKEN }}
30+
31+
- name: Run DCO Check
32+
uses: dcoapp/[email protected]
33+
with:
34+
github-token: ${{ secrets.GITHUB_TOKEN }}
35+
# Enable verbose output for better debugging
36+
verbose: true
37+
38+
- name: DCO Check Results
39+
if: failure()
40+
run: |
41+
echo "❌ DCO check failed!"
42+
echo "All commits must be signed off with 'Signed-off-by: Your Name <[email protected]>'"
43+
echo "To fix this, you can:"
44+
echo "1. Add 'Signed-off-by' to your commit messages manually"
45+
echo "2. Use 'git commit -s' for future commits"
46+
echo "3. Amend existing commits with 'git commit --amend -s'"
47+
echo "4. For multiple commits, use 'git rebase --signoff HEAD~n' where n is the number of commits"
48+
exit 1
49+
50+
- name: DCO Check Success
51+
if: success()
52+
run: |
53+
echo "✅ All commits are properly signed off!"
54+
echo "DCO compliance verified successfully."

0 commit comments

Comments
 (0)