A GitHub webhook handler and deployment automation tool. Knit listens for GitHub webhook events, validates signatures, updates local repositories, runs deployment commands, and sends notifications (e.g., to Discord). Use this as a foundation for automating deployments and notifications for your projects.
- GitHub webhook listener (Express server)
- Signature validation for security
- Automated repository updates and deployment commands
- Discord webhook notifications for deployments and errors
- Interactive CLI wizard for repository configuration
- Pre-configured for Node.js (ESM)
- Environment variable support via dotenv
- Logging and signal handling via
@purinton/common
- Jest for testing
- MIT License
-
Clone this template:
git clone https://github.com/purinton/knit.git cd knit npm install
-
Update project details:
- Edit
package.json
(name, description, author, etc.) - Update this
README.md
as needed - Change the license if required
- Edit
-
Configure your repositories:
-
Run the interactive wizard:
./wizard.mjs
-
This will guide you through setting up deployment paths, commands, and notification URLs for each repository.
-
-
Set up your GitHub webhook:
- Point your repository’s webhook to your Knit server URL (e.g.,
https://yourdomain.com/
) - Use content type
application/json
- Set the webhook secret to match your
.env
file’sGITHUB_WEBHOOK_SECRET
- Point your repository’s webhook to your Knit server URL (e.g.,
-
Main entry:
knit.mjs
-
Start your app:
./knit.mjs
-
Add your code in new files and import as needed.
-
Run tests with:
npm test
-
Add your tests in the
tests
folder or alongside your code.
- Extend the logging, notification, or deployment logic as needed.
- Add dependencies and scripts to fit your project.
- Remove or modify template files and sections.
For help, questions, or to chat with the author and community, visit: