From 019706747a02f824fc092624304c69d8ddf83c5f Mon Sep 17 00:00:00 2001
From: Awiteb
Date: Sun, 14 Jul 2024 04:00:23 +0300
Subject: [PATCH] feat: Developer Certificate of Origin
Reviewed-on: https://git.4rs.nl/OxideTalis/oxidetalis/pulls/17
Fixes: https://git.4rs.nl/OxideTalis/oxidetalis/issues/16
Signed-off-by: Awiteb
---
.forgejo/workflows/dco_checker.yml | 29 +++++++++++++++++++++++++
CONTRIBUTING.md | 21 ++++++++++++++++++
DCO | 34 ++++++++++++++++++++++++++++++
3 files changed, 84 insertions(+)
create mode 100644 .forgejo/workflows/dco_checker.yml
create mode 100644 DCO
diff --git a/.forgejo/workflows/dco_checker.yml b/.forgejo/workflows/dco_checker.yml
new file mode 100644
index 0000000..9196cab
--- /dev/null
+++ b/.forgejo/workflows/dco_checker.yml
@@ -0,0 +1,29 @@
+name: DCO checker
+
+on:
+ pull_request:
+ branches: [master]
+ types: [opened, synchronize, reopened]
+
+jobs:
+ check:
+ name: DCO checker
+ runs-on: debian
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - name: DCO checker
+ run: |
+ commits=$(git rev-list origin/master..HEAD)
+ for commit in $commits; do
+ commit_subject=$(git show --quiet --format=%s $commit)
+ commit_sha=$(echo $commit | cut -c1-10)
+ echo "Checking commit $commit_sha \"$commit_subject\""
+ if ! git show --quiet --format=%B $commit | grep -q "Signed-off-by:"; then
+ author=$(git show --quiet --format=%an $commit)
+ echo "Commit $commit by $author is missing the 'Signed-off-by:' line"
+ exit 1
+ fi
+ done
+ echo "All commits have the 'Signed-off-by:' line."
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 26f68f1..a1b64a8 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -16,6 +16,27 @@ If you have a feature request or an idea for improving oxidetalis, we encourage
you to open a new issue on the Forgejo repository. Please describe the feature
or improvement in detail and provide any relevant context or examples.
+## Developer Certificate of Origin (DCO)
+Please note that all contributions to oxidetalis must be made under the terms of
+the Developer Certificate of Origin (DCO). This is a legal statement that
+certifies that you have the right to contribute the code and that you agree to
+license it under the project's licenses. Please read the DCO carefully before
+making a contribution, you can find the DCO here [DCO](./DCO).
+
+To indicate that you agree to the terms of the DCO, you can add a
+`Signed-off-by` line to your commit messages. This can be done by adding the
+`-s` flag to the `git commit` command, for example:
+
+```bash
+git commit -s -m "feat: Add new feature"
+```
+
+> **Note**
+>
+> We will not accept contributions that do not include the `Signed-off-by` line
+> in the commit message. We may ask you to re-submit your contribution with the
+> `Signed-off-by` line if it is missing.
+
## Writing Code
Before you start writing code, please open a new issue first to discuss the
proposed changes. This will help ensure that your contribution is aligned with
diff --git a/DCO b/DCO
new file mode 100644
index 0000000..49b8cb0
--- /dev/null
+++ b/DCO
@@ -0,0 +1,34 @@
+Developer Certificate of Origin
+Version 1.1
+
+Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
+
+Everyone is permitted to copy and distribute verbatim copies of this
+license document, but changing it is not allowed.
+
+
+Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+(a) 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
+
+(b) 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
+
+(c) The contribution was provided directly to me by some other
+ person who certified (a), (b) or (c) and I have not modified
+ it.
+
+(d) 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.