Organization owners and repository admins can now require developers to sign off on commits made through GitHub's web interface. Also, it is now easier for developers to complete a signoff in the web interface.
Note: Signing off on a commit is different than signing a commit, such as with a GPG key.
Background
The Git command line interface has a --signoff
option that developers can use to sign off on their commits. Many open-source organizations require developers to sign off on their changes to affirm compliance with repository rules and licensing. Git's --signoff
option appends a specially formatted line to the commit message, as shown here:
Signed-off-by: Mona Lisa <mona@github.com>
This text is what constitutes a signoff. It is often called a “DCO signoff” because the most common signoff agreement is the Developer Certificate of Origin (DCO) from the Linux Foundation.
Challenges
Open-source projects often use pull request checks to block commits from being merged unless they're signed off. Here’s an example of a commit being blocked in the open-source Gradle Profiler repository, which uses the Probot GitHub App to check whether all of a pull request's commits are signed off:
![A pull request check that failed because a commit was not signed off](./?url=aHR0cHM6Ly9pMC53cC5jb20vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzE3Njc0MTUvMTY2MTU5ODk3LTQ5Y2ZiYmMwLWM3YmUtNGVmYi1hYjE0LTE1ZDVhN2JmNTY1OS5wbmc/c3NsPTE=&__proxy_form=0)
This problem is more likely when committing from GitHub's web interface where Git’s --signoff
option isn't available. To sign off there, developers must manually add the Signed-off-by:
text to their commit message. That's easy to overlook or misformat, resulting in the commit being blocked from merging. Resolving this situation can be complicated and slow developers down, as shown in these instructions to fix one commit:
![Instructions for amending a commit that is not signed off](./?url=aHR0cHM6Ly9pMC53cC5jb20vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzE3Njc0MTUvMTY2MjM2MTQ3LThhZTQ4OTM2LTVjZjQtNDViZS05NDI5LTM3MjkwMGU3ZmYwOS5wbmc/c3NsPTE=&__proxy_form=0)
In the words of one open-source contributor:
🤦 As a pull request reviewer, this is my biggest pain point. If someone forgets to manually sign off on a commit in the web UI, the pull request check fails and the only resolution is to rebase or squash and force push to fix the commit message. Either way, the review history becomes unclear. This is high friction for new and infrequent contributors and people forget.
New signoff capabilities
Organization owners and repository admins can now require developers to sign off on commits made through GitHub's web interface, such as when editing a file or merging a pull request.
Also, it is now easier for developers to complete a signoff in the web interface, resulting in fewer commits being blocked from merging and less time spent resolving blocked commits.
How to enable required signoffs for an organization
Organization owners can configure an organization-level setting to require sign off on commits made through the web interface. To do so, click Settings in an organization that you are an owner of. Next, in the navigation under Code, planning, and automation, select Repository and then Repository defaults. Finally, under Commit signoff choose All repositories to require sign off on web-based commits in all repositories in the organization, as shown below. Alternatively, select No policy to disable the setting so that sign off will not be required unless enabled at the repository level.
![GitHub's organization-level setting for requiring sign off on commits made in the web interface](./?url=aHR0cHM6Ly9pMC53cC5jb20vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzE3Njc0MTUvMTcyMzg4MTE3LTkyMGM5MDQzLWM2MTYtNDljZi05NjJmLTY5NDdjMDQ5YWRjYi5wbmc/c3NsPTE=&__proxy_form=0)
How to enable required signoffs for a repository
Repository admins can toggle a similar repository-level setting. To do so, click Settings in a repository that you are an admin of. Next, select General (the default, top-most tab). Then toggle the setting named Require contributors to sign off on web-based commits as shown below. This setting will be overridden by the organization-level setting unless the organization has No policy selected.
![GitHub's repository-level setting for requiring sign off on commits made in the web interface](./?url=aHR0cHM6Ly9pMC53cC5jb20vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzE3Njc0MTUvMTcyMjc2MzQ2LWZiNGMwOWE0LTJlNDctNGZkOS1hZDYxLTQ1MWEwMDgxNzVjNy5wbmc/c3NsPTE=&__proxy_form=0)
When the setting is enabled, the web interface will inform developers that their action of committing will also constitute signing off, as shown below. Like using Git's --signoff
option on the command line, signing off in the web interface will automatically append the Signed-off-by:
text to the commit message.
![GitHub's web interface for committing will inform developers that they are also signing off when they commit](./?url=aHR0cHM6Ly9pMC53cC5jb20vdXNlci1pbWFnZXMuZ2l0aHVidXNlcmNvbnRlbnQuY29tLzE3Njc0MTUvMTY2MTcxMzgxLWI3MDQzOGM3LTkyOGEtNDQyOS04OTQ3LTYxMGU3NDE3OGVlYy5wbmc/c3NsPTE=&__proxy_form=0)
Related to this feature, GitHub is planning a Git push policy setting that blocks commits from even entering a repository if they are not signed off. This will apply to commits made in GitHub's web interface or pushed from the Git command line or another Git client.
We appreciate feedback on this and other topics in GitHub's public feedback discussions.