This repository is an example of a custom deployment protection rule.
To use this demo app...
- Create a GitHub App as described here.
- Follow the instructions in the deployment section below.
- Configure the deployment protection rule for your repo. See documentation here.
Install dependencies
npm install
Start the server
npm start
Follow the instructions to register a new GitHub app.
Get the following details about your GitHub app:
APP_ID
WEBHOOK_SECRET
PRIVATE_KEY
- Setup your aws cli creds
- set your aws profile by running
export AWS_PROFILE=<profile>
- run
sam build
- run
sam deploy --guided
Subsequent deploys to the same stack to the default environment...
- run
sam build
- run
sam deploy
There are two options to debug locally.
- Intall nyc and mocha:
npm install -g nyc mocha
- From the VSCode
RUN AND DEBUG
menu selectMocha
and click the green arrow to start debugging.
- Point your GitHub app to your local using something like smee.io
- Copy .env-sample to .env and populate with values specific for your GitHub app. See here for more details.
- From the VSCode
RUN AND DEBUG
menu selectLaunch Probot
and click the green arrow to start debugging.
# 1. Run npm install
npm install
# 2. Build container
docker build -t my-probot-app .
# 3. Srouce your .env file
export $(cat .env | xargs)
# 3. Start container
docker run \
-e APP_ID=$APP_ID \
-e PRIVATE_KEY=$PRIVATE_KEY \
-e WEBHOOK_SECRET=$WEBHOOK_SECRET \
my-probot-app