Skip to content

Commit cd5b0ac

Browse files
Document preview setup and permissions
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 4b5287d commit cd5b0ac

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

.github/PR-PREVIEW.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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 |

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
This repository contains the documentation for the [PSModule](https://psmodule.io) development framework.
44

55
Visit [psmodule.io/docs](https://psmodule.io/docs) to read the documentation created in this repository.
6+
7+
PRs automatically publish a docs preview at `https://psmodule.io/docs/previews/pr-<number>/` and update the same preview URL as new commits are pushed. The preview is removed when the PR closes (merged or abandoned). See [.github/PR-PREVIEW.md](.github/PR-PREVIEW.md) for setup and required bot permissions.

0 commit comments

Comments
 (0)