๐ A real-time GitHub auto-sync tool.
A simple HTTP server written in Go that monitors pushes to your GitHub repository in real-time, and pulls them from your GitHub repository.
- Go >= 1.19
- Git
You can install it via go install
command.
go install github.com/lareii/autopull@latest
You can add the tool to path for quick access. (optional)
-
Choose a repository and click on the "Settings" tab at the top of the repository page.
-
Locate the "Webhooks" section in the left-hand sidebar.
-
In the Webhooks section, there is typically a button labeled "Add webhook" or "New webhook". Click on it to start creating a new webhook.
-
In the "Payload URL" field, enter the URL where you want GitHub to send the payload when an event occurs.
-
In the "Content type" field, select
application/json
. -
Scroll down to the "Secret" section. Generate a secure secret key and enter it in the "Secret" field. This key will be used to secure the communication between GitHub and your server.
-
Select "Just the push event." as the event that should trigger the webhook.
-
After configuring the webhook settings, scroll down and click on the "Add webhook" or "Create webhook" button to save your changes.
-
Once the webhook is added, GitHub will send a test payload to the provided URL. Ensure that your server can receive and process this payload.
-
Back in the Webhooks section, you should see your newly added webhook. Verify that the "Recent Deliveries" section shows a successful delivery status.
autopull <repo_path> <secret>
Example usage:
autopull ~/website "mysupersecretoken"
๐ Ta-da! Ready to use. Try to push something.
Contributions are welcome! To contribute, simply fork the repository, make your desired changes, and submit a pull request.
This project is licensed under the MIT License. For more information, see the LICENSE file.