dcoapp / app

GitHub App that enforces the Developer Certificate of Origin (DCO) on Pull Requests
https://github.com/apps/dco
ISC License
299 stars 75 forks source link

Use as "pre-commit" hook? #173

Open aparcar opened 2 years ago

aparcar commented 2 years ago

Is it possible to run the DCO app before each commit and block it in case the DCO check fails?

GitHub does not allow custom hooks, however we'd like to check that every commit happening to our repository contains a "Signed-of-by" line.

gr2m commented 2 years ago

we'd like to check that every commit happening to our repository contains a "Signed-of-by" line

Would you like a badge showing that every commit in a repository does have the "Signed-of-by" line? Or do you want to prevent new commits to be added that do not?

aparcar commented 2 years ago

We want to prevent commits to be added that do not contain a valid Signed-of-by line. Currently we use GitHub as a mirror and our own Git server setup validates each push before committing anything. Moving over to GitHub as our main and only Git source would ideally have this hard requirement, too.

gr2m commented 2 years ago

You can prevent direct pushes to a repository's default branch using branch protection settings, enforcing using pull requests. And on pull requests, DCO will set a status to failed when the commit messages do not have the signed-of-by line. Will that work for you?