Using environments for approvals and checks
In this recipe, we are going to use environment approvals to acquire approval before creating the repository. We will also use a GitHub App to authenticate as the repository creation normally happens in the organization scope and cannot be done with GITHUB_TOKEN
. You must either use a GitHub App or a personal access token (PAT) with the right scopes.
Getting ready…
Make sure you have completed the previous recipe and continue in the same repository.
How to do it…
- In your repository, go to Setting | Environments and click New environment.
- Name the environment
repo-creation
and click Configure environment. - Add yourself as Required reviewer and don’t allow administrators to bypass the rule (see Figure 5.7).
Figure 5.7 – Configuring the environment protection rules
- Click Save protection rules.
- The next step is to create an app to authenticate. I recommend...