Skip to content

Commit e2bcec8

Browse files
authored
Merge pull request #41 from negillett/add-ci-and-dco
Add CI workflow, DCO check, NOTICE, and CONTRIBUTING
2 parents 39f0ab4 + c7aa866 commit e2bcec8

4 files changed

Lines changed: 120 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build-test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: actions/setup-python@v5
16+
with:
17+
python-version: '3.11'
18+
19+
- name: Install dependencies
20+
run: |
21+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
22+
if [ -f pyproject.toml ]; then pip install -e .; fi
23+
24+
- name: Run tests
25+
run: |
26+
if [ -z "$(find tests -type f -name '*.py' 2>/dev/null)" ]; then
27+
echo "No test files found (project scaffold only)"
28+
exit 0
29+
fi
30+
python -m unittest discover -s tests -v

.github/workflows/dco.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: dco
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
check:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
14+
- name: Require Signed-off-by trailer on every commit
15+
run: |
16+
base="${{ github.event.pull_request.base.sha }}"
17+
head="${{ github.event.pull_request.head.sha }}"
18+
fail=0
19+
for sha in $(git rev-list "$base".."$head"); do
20+
body=$(git log -1 --format=%B "$sha")
21+
author_email=$(git log -1 --format=%ae "$sha")
22+
soby=$(echo "$body" | grep -oE '^Signed-off-by: .+ <.+@.+>$' || true)
23+
if [ -z "$soby" ]; then
24+
echo "Commit $sha is missing a Signed-off-by trailer." >&2
25+
fail=1
26+
else
27+
soby_email=$(echo "$soby" | grep -oE '<.+@.+>' | tr -d '<>')
28+
if [ "$soby_email" != "$author_email" ]; then
29+
echo "Commit $sha: Signed-off-by email ($soby_email) does not match author email ($author_email)." >&2
30+
fail=1
31+
fi
32+
fi
33+
done
34+
if [[ $fail -ne 0 ]]; then
35+
echo "" >&2
36+
echo "All commits in this PR must be signed off via the DCO." >&2
37+
echo "See CONTRIBUTING.md. Use 'git commit -s' or amend with 'git commit --amend -s'." >&2
38+
exit 1
39+
fi
40+
echo "PASS: all commits carry Signed-off-by trailers."

CONTRIBUTING.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Contributing to intentproof-sdk-python
2+
3+
Thanks for your interest in contributing to the IntentProof Python SDK.
4+
5+
## Developer Certificate of Origin (DCO)
6+
7+
This repository accepts contributions under the
8+
[Developer Certificate of Origin 1.1](https://developercertificate.org/).
9+
We deliberately use DCO instead of a Contributor License Agreement
10+
for the Apache repositories so the contribution path stays
11+
frictionless.
12+
13+
Every commit must carry a `Signed-off-by:` trailer matching the
14+
author email. The easiest way to do this is to pass `-s` to `git
15+
commit`:
16+
17+
```bash
18+
git commit -s -m "..."
19+
```
20+
21+
You can also retroactively sign off the last commit with:
22+
23+
```bash
24+
git commit --amend --no-edit -s
25+
```
26+
27+
Then force-push the amended branch:
28+
29+
```bash
30+
git push --force-with-lease
31+
```
32+
33+
Commits that do not include a valid `Signed-off-by` trailer will
34+
be rejected by CI.

NOTICE

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
IntentProof Python SDK
2+
Copyright 2026 IntentProof, Inc.
3+
4+
This product includes software developed at IntentProof, Inc.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.

0 commit comments

Comments
 (0)