Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use as "pre-commit" hook? #173

Open
aparcar opened this issue Jan 7, 2022 · 3 comments
Open

Use as "pre-commit" hook? #173

aparcar opened this issue Jan 7, 2022 · 3 comments

Comments

@aparcar
Copy link

aparcar commented Jan 7, 2022

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
Copy link
Contributor

gr2m commented Jan 7, 2022

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
Copy link
Author

aparcar commented Jan 8, 2022

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
Copy link
Contributor

gr2m commented Jan 8, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants