Skip to content

docs: document one-time fork setup (Pages + Actions PRs + Template toggle) - #10

Merged
agjs merged 1 commit into
mainfrom
fix/pages-docs
Apr 21, 2026
Merged

docs: document one-time fork setup (Pages + Actions PRs + Template toggle)#10
agjs merged 1 commit into
mainfrom
fix/pages-docs

Conversation

@agjs

@agjs agjs commented Apr 21, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces the failed enablement: true approach in #8 with honest documentation.

The problem

  • actions/configure-pages can't create a Pages site with the default GITHUB_TOKEN — that needs administration: write, which we intentionally don't grant (would violate the Token-Permissions least-privilege posture we just landed).
  • enablement: true turned the old 404 ("no Pages site") into a 403 ("can't create"), not a fix.
  • The honest answer: Pages must be turned on once per fork. It's one click.

This PR

  • Reverts enablement: true from deploy-pages.yml, adds a comment explaining why.
  • README.md: new "After forking: one-time repo setup" section under the template call-out.
  • BUILD_THE_GAME.md: same three settings as a table in Step 3.5, with CLI equivalents.

The three settings:

Setting Path
Pages Settings → Pages → Source: "GitHub Actions"
Actions may open PRs Settings → Actions → General → Workflow permissions
Template repository Settings → General → Template repository

Test plan

  • Enable Pages in repo Settings
  • Merge this PR → next deploy-pages run should succeed and publish to https://agjs.github.io/Phaser-TypeScript-AI-First-Starter/

Reverts the enablement: true in deploy-pages.yml because the default
GITHUB_TOKEN can't create a Pages site (it would need administration:
write, which violates the least-privilege stance we just adopted for
the Token-Permissions Scorecard findings).

Instead, document the one-time setup clearly:

- README.md: new 'After forking: one-time repo setup' section right
  under the 'Use this template' call-out, covering Pages enablement,
  Actions-can-open-PRs, and the Template repository toggle.
- BUILD_THE_GAME.md: same three settings as a table in Step 3.5,
  with CLI equivalents for users who prefer gh api.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 21, 2026 20:02
@agjs agjs changed the title docs: document one-time repo setup for Pages + Actions PR creation docs: document one-time fork setup (Pages + Actions PRs + Template toggle) Apr 21, 2026
@agjs
agjs merged commit 9e9ec52 into main Apr 21, 2026
7 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds documentation for essential one-time repository configuration steps required after forking, including settings for GitHub Pages, Actions permissions, and template repository status. These instructions are added to both README.md and BUILD_THE_GAME.md. The review feedback suggests improving the provided GitHub CLI commands by using :owner/:repo placeholders, which allows the CLI to automatically substitute the correct values for the user.

Comment thread BUILD_THE_GAME.md

```sh
# Pages (Source = Actions) — needs a PAT with `administration: write`
gh api -X POST /repos/<owner>/<repo>/pages -f 'build_type=workflow'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using the :owner/:repo placeholders in the gh api command allows the GitHub CLI to automatically substitute the current repository's owner and name. This makes the command copy-pasteable for users who have already cloned the repository, removing the need for manual string replacement.

Suggested change
gh api -X POST /repos/<owner>/<repo>/pages -f 'build_type=workflow'
gh api -X POST /repos/:owner/:repo/pages -f 'build_type=workflow'

Comment thread BUILD_THE_GAME.md
Comment on lines +111 to +112
gh api -X PUT /repos/<owner>/<repo>/actions/permissions/workflow \
-f default_workflow_permissions=write -F can_approve_pull_request_reviews=true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Similar to the Pages setup, leveraging :owner/:repo here enables automatic substitution by the gh CLI, streamlining the setup process for developers.

Suggested change
gh api -X PUT /repos/<owner>/<repo>/actions/permissions/workflow \
-f default_workflow_permissions=write -F can_approve_pull_request_reviews=true
gh api -X PUT /repos/:owner/:repo/actions/permissions/workflow \
-f default_workflow_permissions=write -F can_approve_pull_request_reviews=true

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents the required one-time GitHub repository settings for new repos created from this template, and removes Pages auto-enablement in the Pages deploy workflow to maintain least-privilege GITHUB_TOKEN permissions.

Changes:

  • Add “one-time repo setup” instructions to README.md after the template usage callout.
  • Add a Step 3.5 settings table + gh api equivalents to BUILD_THE_GAME.md.
  • Remove enablement: true from deploy-pages.yml and explain the manual Pages enablement requirement.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
README.md Adds quick, prominent one-time repo setup steps for template users.
BUILD_THE_GAME.md Adds detailed per-repo settings guidance + CLI alternatives.
.github/workflows/deploy-pages.yml Stops auto-enabling Pages; adds rationale comment aligned with least privilege.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread README.md
### After forking: one-time repo setup

1. **Enable GitHub Pages** — `Settings → Pages → Build and deployment → Source: "GitHub Actions"`. Without this the `deploy-pages` workflow 404s on the first run.
2. **Allow Actions to open PRs** (so release-please can cut release PRs) — `Settings → Actions → General → Workflow permissions → [x] Allow GitHub Actions to create and approve pull requests`.

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UI path for enabling release-please is missing the required “Workflow permissions: Read and write permissions” selection. If the repo default is read-only, the release-please workflow’s requested contents: write / pull-requests: write permissions won’t be granted, and it won’t be able to open/update the release PR. Suggest updating this step to mention selecting “Read and write permissions” (and optionally keeping the PR checkbox as a separate sub-step).

Suggested change
2. **Allow Actions to open PRs** (so release-please can cut release PRs) — `Settings → Actions → General → Workflow permissions → [x] Allow GitHub Actions to create and approve pull requests`.
2. **Allow Actions to open PRs** (so release-please can cut release PRs) — `Settings → Actions → General → Workflow permissions → Select "Read and write permissions"`, then enable `[x] Allow GitHub Actions to create and approve pull requests`.

Copilot uses AI. Check for mistakes.
Comment thread BUILD_THE_GAME.md
| Setting | Path | Why |
| --- | --- | --- |
| **Pages** | Settings → Pages → Build and deployment → Source: **"GitHub Actions"** | The `deploy-pages` workflow 404s without this; the workflow can't enable Pages itself without a broader token. |
| **Actions may open PRs** | Settings → Actions → General → Workflow permissions → **[x] Allow GitHub Actions to create and approve pull requests** | So `release-please` can cut release PRs from conventional commits. |

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section points to the “Allow GitHub Actions to create and approve pull requests” checkbox, but it doesn’t mention setting “Workflow permissions” to “Read and write permissions”. With the default set to read-only, workflows can’t elevate to contents: write / pull-requests: write, which would break release-please PR creation. Suggest updating the row (or adding a note) to include both the read/write radio option and the checkbox.

Suggested change
| **Actions may open PRs** | Settings → Actions → General → Workflow permissions → **[x] Allow GitHub Actions to create and approve pull requests** | So `release-please` can cut release PRs from conventional commits. |
| **Actions may open PRs** | Settings → Actions → General → Workflow permissions → **Read and write permissions**; then **[x] Allow GitHub Actions to create and approve pull requests** | So workflows can actually get `contents: write` / `pull-requests: write`, and `release-please` can cut release PRs from conventional commits. |

Copilot uses AI. Check for mistakes.
Comment thread README.md
Comment on lines 20 to +22
> **Use this as a GitHub template.** Click **"Use this template"** on the repo page, fork it into a new repo for each game, then read [`BUILD_THE_GAME.md`](./BUILD_THE_GAME.md) to walk from empty fork to shipped feature.

### After forking: one-time repo setup

Copilot AI Apr 21, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section says “After forking”, but the instructions immediately above are to use the repo as a template (“Use this template”), which creates a new repo rather than a GitHub fork. Consider renaming this heading/wording to “After creating your repo from the template” to avoid confusion (especially since GitHub’s UI distinguishes forks vs template-generated repos).

Suggested change
> **Use this as a GitHub template.** Click **"Use this template"** on the repo page, fork it into a new repo for each game, then read [`BUILD_THE_GAME.md`](./BUILD_THE_GAME.md) to walk from empty fork to shipped feature.
### After forking: one-time repo setup
> **Use this as a GitHub template.** Click **"Use this template"** on the repo page, create a new repo from this template for each game, then read [`BUILD_THE_GAME.md`](./BUILD_THE_GAME.md) to walk from empty repo to shipped feature.
### After creating your repo from the template: one-time repo setup

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants