Skip to content

Commit 3eef222

Browse files
docs: add deployment guide (#29)
1 parent 98fcefe commit 3eef222

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

README.md

+24-4
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,24 @@
1-
# Sample GitHub App
1+
# Rudder GitHub App
22

3-
This sample app showcases how webhooks can be used with a GitHub App's installation token to create a bot that responds to issues. Code uses [octokit.js](https://github.com/octokit/octokit.js).
3+
A Node.js server for GitHub app to assist external contributors and save maintainers' time
4+
5+
## Roadmap
6+
7+
- [x] When an external contributor (not the internal team) raises a PR, post a comment to sign CLA and label PR `Pending CLA``
8+
- [x] On signing CLA, remove `Pending CLA`` label and never ask that user to sign the CLA again on any of our repo in future [DONE]
9+
- [x] On `rudder-transformer`` PR merge, post a comment to raise PR in `integrations-config`
10+
- [ ] On `integrations-config`` PR merge, psot a comment to join Slack's product-releases channel to get notified when that integration goes live
411

512
## Requirements
613

714
- Node.js 20 or higher
815
- A GitHub App subscribed to **Pull Request** events and with the following permissions:
916
- Pull requests: Read & write
1017
- Metadata: Read-only
11-
- (For local development) A tunnel to expose your local server to the internet (e.g. [smee](https://smee.io/), [ngrok](https://ngrok.com/) or [cloudflared](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide/local/))
1218
- Your GitHub App Webhook must be configured to receive events at a URL that is accessible from the internet.
19+
- (Only for local development) A tunnel to expose your local server to the internet (e.g. [smee](https://smee.io/), [ngrok](https://ngrok.com/) or [cloudflared](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/tunnel-guide/local/))
1320

14-
## Setup
21+
## Development setup
1522

1623
1. Clone this repository.
1724
2. Create a `.env` file similar to `.env.example` and set actual values. If you are using GitHub Enterprise Server, also include a `ENTERPRISE_HOSTNAME` variable and set the value to the name of your GitHub Enterprise Server instance.
@@ -21,6 +28,19 @@ This sample app showcases how webhooks can be used with a GitHub App's installat
2128
- If you're using `smee`, run `smee -u <smee_url> -t http://localhost:3000/api/webhook`.
2229
6. Ensure your GitHub App includes at least one repository on its installations.
2330

31+
## Deployment
32+
33+
### Using `Docker`
34+
35+
1. [Register a GitHub app](https://docs.github.com/en/apps/creating-github-apps/registering-a-github-app/registering-a-github-app) for your GitHub organization. Make sure to activate the webhook with webhook url `https://YOUR_WEBSITE/api/webhook` in your app with a secret. Enable Permissions & Events as you may need, at minimum pull_request and issue related events should be enabled.
36+
2. Install your GitHub app in all the repos where you need this app.
37+
3. Clone this repo
38+
4. Update `docker-compose.yml` environment variables with the details received from the step 2
39+
> To convert GitHub App's private key to base64, use this command - `openssl base64 -in /path/to/original-private-key.pem -out ./base64EncodedKey.txt -A`
40+
5. Run `docker-componse build` to build the service
41+
6. Run `docker-compose up` to create and start the container
42+
7. Test by visiting `http://localhost:3000`
43+
2444
## Usage
2545

2646
With your server running, you can now create a pull request on any repository that

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"name": "rudder_github_app",
3+
"description": "Assistant for external contributors",
34
"private": false,
4-
"version": "0.0.2",
5+
"version": "0.1,0",
56
"type": "module",
67
"scripts": {
78
"lint": "standard",
@@ -19,4 +20,4 @@
1920
"engines": {
2021
"node": ">=20"
2122
}
22-
}
23+
}

0 commit comments

Comments
 (0)