|
| 1 | +# PR docs preview setup |
| 2 | + |
| 3 | +This repository publishes docs previews for pull requests under: |
| 4 | + |
| 5 | +- `https://psmodule.io/docs/previews/pr-<number>/` |
| 6 | + |
| 7 | +## What the workflow does |
| 8 | + |
| 9 | +1. On PR open/reopen/synchronize: |
| 10 | + - builds docs with preview-specific `site_url`, |
| 11 | + - updates `previews/pr-<number>/` content via a PR into `gh-pages`, |
| 12 | + - enables auto-merge for that `gh-pages` PR, |
| 13 | + - comments on the source PR with the preview URL, |
| 14 | + - reports the preview URL through a named environment (`pr-preview-<number>`). |
| 15 | +2. On PR close (merge or abandon): |
| 16 | + - removes `previews/pr-<number>/` via a PR into `gh-pages`, |
| 17 | + - enables auto-merge for that cleanup PR, |
| 18 | + - deletes all preview deployments and the preview environment. |
| 19 | + |
| 20 | +## Required repository configuration |
| 21 | + |
| 22 | +1. Ensure `gh-pages` branch exists. |
| 23 | +2. Configure GitHub Pages to publish from `gh-pages`. |
| 24 | +3. Protect `gh-pages` so direct commits are blocked and updates happen through PRs only. |
| 25 | +4. Allow auto-merge for PRs in this repository. |
| 26 | + |
| 27 | +## Scribbler GitHub App permissions |
| 28 | + |
| 29 | +The app needs the following repository permissions: |
| 30 | + |
| 31 | +| Permission | Access | Why | |
| 32 | +| --- | --- | --- | |
| 33 | +| Metadata | Read | Required baseline for API access | |
| 34 | +| Contents | Read & write | Push preview/cleanup branches and update content | |
| 35 | +| Pull requests | Read & write | Create/update/merge PRs into `gh-pages` | |
| 36 | +| Issues | Read & write | Post and update preview comments on PR threads | |
| 37 | +| Deployments | Read & write | Deactivate and delete preview deployments | |
| 38 | +| Administration | Read & write | Delete per-PR environments during cleanup | |
0 commit comments