This repository serves as a demo for enabling deployment protection rules for target environments.
For demo purposes, be sure to follow the steps below:
- Fork this repo to your organization: https://github.com/github-technology-partners/protection-rules-playground/fork
- Enable GitHub Pages (see GitHub Pages)
- Confirm Action workflow is running (see Deploy)
- Install GitHub demo application (see DPR Validator)
- Install your protection rule application (be sure to include any configuration specific to your application)
- Enable environment protection rules (see Protection Rules)
- Run the workflow to see your rules in action!
To enable GitHub Pages for a repository, visit settings/pages
- Visit settings/pages
- Under "Build and deployment" choose GitHub Actions
- Settings are autosaved
- Click the Actions tab
- Select "Deploy static content GitHub Pages" from the workflows list in the sidebar
- Click "Run workflow" from a target branch (typically
main)
For this demo, we have an application that will always approve an incoming request.
- Visit https://github.com/apps/dpr-validator
- Click install
- Choose the org you forked this repo into
- Select "Only select repositories"
- Choose the fork of this repo
For demo purposes, be sure to configure the following:
- Visit settings/environments
- Select "github-pages"
- Enable "Required reviewers" and choose a user from your organization
- Enable a "Wait timer" with a time of 1 min
- Enable "DPR Validator"
- Enable your custom application
- Click "Save protection rules"