app icon indicating copy to clipboard operation
app copied to clipboard

Use as "pre-commit" hook?

Open aparcar opened this issue 2 years ago • 3 comments

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.

aparcar avatar Jan 07 '22 09:01 aparcar

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?

gr2m avatar Jan 07 '22 23:01 gr2m

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.

aparcar avatar Jan 08 '22 00:01 aparcar

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?

gr2m avatar Jan 08 '22 05:01 gr2m