GitHub webhook for closing all new GitHub PRs with a custom message.
GitHub does not support deactivating pull requests. However, some organization do not want to use the GitHub PR feature and only use GitHub as a read-only git mirror.
- It uses GitHub webhooks and does not require a cronjob.
- It optionally closes the GitHub PR in addition to adding a configurable comment.
- It is written in hy.
noprs has the following dependencies:
After the dependencies have been installed, the script can be invoked
directly from the repository. If desired, it can also manually be copied
to an element in
$PATH as an executable script.
noprs is configured via two environment variables:
GITHUB_ACCESS_TOKEN: Must be set to a GitHub API access token.
GITHUB_WEBHOOK_SECRET: Must be set to the GitHub webhook secret.
After these environment variables have been set, start
$ hy noprs.hy -a localhost -p 8080 -c my-comment.md
Afterwards, register the webhook on GitHub, either for an entire
organization or a single repository. The
Content-Type must be set to
application/json and the webhook must only deliver PR events.
Test if everything works as expected by creating a new GitHub PR.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.