If you manage community activity (contributions, issues, etc.) outside of GitHub, you may want to disable features within GitHub to prevent contributor confusion. If you decide to pursue any of the guidance below, file a bug to verify that these instructions are right for your project.
Disabling GitHub features
Depending on how you do issue tracking and project management for your project, you may want to disable several GitHub features. These are mostly available directly from the settings menu on a repository or an org.
Closing pull requests
If you have a mirror repository or manage contributions elsewhere, you may want to disable incoming pull requests (PRs). While GitHub does not have a setting to disable PRs on a repository, there is a way to automatically close incoming PRs immediately after they're created.
This may be configured on individual repositories or for an entire org.
Create a configuration for a repository
To close all pull requests to a single repository, create the following file at
# The JSONPath filter expression used to identify which PRs to close. # The data filtered is the pull request data along with other metadata passed in # by probot. # See http://linkremoved/ # `true` will close all PRs. filters: - true # The message to post to the closed PR. commentBody: | Thanks for your contribution! Unfortunately, we don't use GitHub pull requests to manage code contributions to this repository. Instead, please see [CONTRIBUTING.md](../blob/master/CONTRIBUTING.md) which provides full instructions on how to get involved. # Whether to add a label to the closed PR. addLabel: false
Next, install the mistaken-pull-closer app.
Create a configuration for an org
If you would like to close all PRs sent to repositories within a specific org,
create a repo in the org called
.github and create a file called
mistaken-pull-closer.yml in it with the contents above.
If needed, it is possible to combine both an org-level and a repo-level config with inheritance. See here.
Install the mistaken-pull-closer app
Visit the app page and install on the desired scope (select repos or the entire org).
Now PRs should be automatically closed with the comment you have specified!