Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 3 additions & 30 deletions .github/workflows/dco.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: DCO

# Every commit in a pull request must carry a Developer Certificate of Origin sign-off
# (`Signed-off-by: Name <email>`, added by `git commit -s`) whose email is the commit
# author's. CONTRIBUTING.md explains why (see "Licensing of your contribution").
# Merge commits and bot commits (Dependabot) are exempt.
# (`git commit -s`). The check lives in one reusable workflow shared by every public
# synthaea-lab repository: https://github.com/synthaea-lab/.github/blob/main/.github/workflows/dco.yml

on:
pull_request:
Expand All @@ -13,30 +12,4 @@ permissions:

jobs:
dco:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Every commit is signed off by its author
env:
BASE: ${{ github.event.pull_request.base.sha }}
HEAD: ${{ github.event.pull_request.head.sha }}
run: |
missing=0
for c in $(git rev-list --no-merges "$BASE..$HEAD"); do
email=$(git log -1 --format=%ae "$c")
case "$email" in
*'[bot]@users.noreply.github.com') continue ;;
esac
if ! git log -1 --format=%B "$c" | grep -i '^Signed-off-by:' | grep -qiF "<$email>"; then
echo "::error::$(git log -1 --format='%h %s' "$c"): no 'Signed-off-by: ... <$email>' line"
missing=1
fi
done
if [ "$missing" = 1 ]; then
echo "Sign off your commits: 'git commit -s' for new ones, 'git rebase --signoff $BASE' for these, then force-push."
exit 1
fi
echo "All commits are signed off."
uses: synthaea-lab/.github/.github/workflows/dco.yml@main
Loading