- Probot: GitHub Fork Sync
- Install dependencies
- Start the bot
- do chdir before running the service
- limit CPU and RAM quota for our service
This plugin requires these Permissions & events for the GitHub App:
This app only makes use of the following permissions
Permission | Additional Info | Access Level |
---|---|---|
Pull requests |
Read & Write | |
Repository contents |
Read & Write | |
Single File |
Path:.github/auto-fork-sync.yml |
Read-only |
These events are all recommended so that the synchronization process happens more regularly, but whether they are required or not is noted in the table below.
Event | Description | Required |
---|---|---|
Push |
Git push to a repository | Yes |
Create |
Branch or tag created | Yes |
- Log in to GitHub
- Navigate to the
Org
settings - Click the
GitHub Apps
link on the left - Provide the details for the app
- Select the permissions
- Select the events to subscribe to
- If this app will be used by other users and orgs, be sure to allow this to run on Any account
- Generate a
private key
- Download and save the key
- Click on
Install App
- Select the
auto-fork-sync
app - Choose an organization to install it to
- Select the repositories, or choose All repositories and click
Install
- All done! Fork some repos!
# Install dependencies
npm install
# Start the bot
npm start
- Clone the repository
$ git clone https://github.com/primetheus/auto-fork-sync.git
$ cd auto-fork-sync
- Build the image
docker build -t github/auto-fork-sync .
- Run the container
docker run -ditp 3000:3000 --restart unless-stopped --name auto-fork-sync github/auto-fork-sync
You can use the Forever
node package as well. (This assumes you've installed the app to /opt/auto-fork-sync
)
forever start --minUptime 1000 \
--spinSleepTime 1000 \
--workingDir /opt/auto-fork-sync \
-a -w -l /opt/auto-fork-sync/.forever/forever.log \
-o /opt/auto-fork-sync/.forever/out.log \
-e /opt/auto-fork-sync/.forever/err.log \
-c "npm start" ./
You can also run this service as a daemon. This sample assumes that the app is installed in /opt/auto-fork-sync
.
Create a service file in /etc/systemd/system/auto-fork-sync.service
and add the following contents
[Unit]
Description=GitHub Probot - Auto Fork Sync
After=network-online.target
[Service]
PIDFile=/opt/auto-fork-sync/auto-fork-sync.pid
User=node
Group=node
Restart=on-failure
# do chdir before running the service
WorkingDirectory=/opt/auto-fork-sync/
ExecStart=/usr/bin/npm start
KillSignal=SIGQUIT
# limit CPU and RAM quota for our service
CPUAccounting=true
CPUQuota=10%
MemoryAccounting=true
MemoryLimit=250M
[Install]
WantedBy=multi-user.target
Once you've created the file you will be able to enable
, disable
, start
, stop
, restart
and check the status
of the application.
systemctl status auto-fork-sync.service
systemctl enable auto-fork-sync.service
systemctl start auto-fork-sync.service