Skip to content

Commit a2a48d6

Browse files
committed
Require Developer Certificate of Origin (DCO)
Signed-off-by: Jakub Zelenka <bukka@php.net>
1 parent 8376904 commit a2a48d6

File tree

3 files changed

+90
-0
lines changed

3 files changed

+90
-0
lines changed

.github/workflows/dco.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: DCO Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
dco:
9+
name: Check Signed-off-by in commits
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
all_commits: true
17+
18+
- name: Check commits for Signed-off-by
19+
run: |
20+
git fetch origin ${{ github.base_ref }}
21+
git log origin/${{ github.base_ref }}...HEAD --pretty=format:"%h %s%n%b%n==END==" |
22+
awk '
23+
BEGIN { commit = ""; has_signed_off = 0; }
24+
/==END==/ {
25+
if (!has_signed_off) {
26+
print "Commit " commit " is missing Signed-off-by";
27+
exit 1;
28+
}
29+
commit = "";
30+
has_signed_off = 0;
31+
next;
32+
}
33+
/^[0-9a-f]{7,40} / { commit = $1; next; }
34+
/Signed-off-by:/ { has_signed_off = 1; }
35+
'

CONTRIBUTING.md

+21
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,27 @@ and build PHP source code. We recommend to look at our
5959
[workflow](https://wiki.php.net/vcs/gitworkflow) and our
6060
[FAQ](https://wiki.php.net/vcs/gitfaq).
6161

62+
All contributions must comply with the Developer Certificate of Origin.
63+
64+
Each commit must include a Signed-off-by line with your name and email address.
65+
66+
You can add it automatically by using:
67+
68+
```bash
69+
git commit -s
70+
```
71+
72+
Example commit message:
73+
74+
```
75+
Fix bug in X
76+
77+
Signed-off-by: Jane Developer <jane@example.com>
78+
```
79+
80+
By signing off, you confirm that you have the right to submit your code under the
81+
PHP License.
82+
6283
## Filing bugs
6384

6485
Bugs can be filed on [GitHub Issues](https://github.com/php/php-src/issues/new/choose).

DCO.txt

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Developer Certificate of Origin
2+
Version 1.1
3+
4+
Copyright (C) 2025-present PHP Group and its contributors.
5+
6+
Everyone is permitted to copy and distribute verbatim copies of this
7+
license document, but changing it is not allowed.
8+
9+
10+
Developer's Certificate of Origin 1.1
11+
12+
By making a contribution to this project, I certify that:
13+
14+
(a) The contribution was created in whole or in part by me and I
15+
have the right to submit it under the open source license
16+
indicated in the file; or
17+
18+
(b) The contribution is based upon previous work that, to the best
19+
of my knowledge, is covered under an appropriate open source
20+
license and I have the right under that license to submit that
21+
work with modifications, whether created in whole or in part
22+
by me, under the same open source license (unless I am
23+
permitted to submit under a different license), as indicated
24+
in the file; or
25+
26+
(c) The contribution was provided directly to me by some other
27+
person who certified (a), (b) or (c) and I have not modified
28+
it.
29+
30+
(d) I understand and agree that this project and the contribution
31+
are public and that a record of the contribution (including all
32+
personal information I submit with it, including my sign-off) is
33+
maintained indefinitely and may be redistributed consistent with
34+
this project or the open source license(s) involved.

0 commit comments

Comments
 (0)