This project is centered around a mock-customer scenario in which security for branches needs to be applied.
- What is the client name?
- Who are the attendees (their names)?
- What is the "langugage of choice" for client's developers?
- Official "octokit" wrapper has support for Ruby, .NET, and JavaScript. Other wrappers exist, but are third-party.
- Free organizations can only protect public repositories.
To see the code in action, follow the steps below.
Note: all terminal commands should be ran from the cloned repository directory.
- Clone this repository
- Install Prerequisites
- Ngrok (instructions)
- Node.JS (instructions)
- Install node dependencies with the command
npm i
- Create a secret with the command
npm run secret
- Create a personal access token (instructions)
- Create env file:
- Make a copy of
env.demo
and save it asenv
. - Update the contents, replacing all
<variables>
with the appropriate values from steps 4 and 5, then save. - Source the environment file with the command
. ./env
- Make a copy of
- Create a new organization (instructions)
- Run Ngrok with the command
npm run server
(must stay running). - Create a new webhook for your organization (instructions)
- Use
application/json
forcontent type
- Use the Ngrok url from the terminal that is running it for
Payload URL
- For secret, paste the value from step #4.
- For events, choose
Let me select individual events.
and checkRepositories
- Make sure
Active
is checked.
- Use
- In a separate terminal, run command
npm run app
- Attempt to create a new public repository in your organization
The new repository will have two branches (main
and dev
) created automatically, as well as branch protection rules.
- If the code fails after trying to protect the main branch, make sure you set the repository as public and NOT private.
- Add an issue to the repository with an @ mention for myself.
???
github-presentation.pptx
: contains the presentation slide deck.