Skip to content

fix(website): scope Pages permissions and make kit removal non-destructive - #3

Merged
DaniAkash merged 2 commits into
mainfrom
fix/pr1-review
Oct 23, 2026
Merged

DaniAkash merged 2 commits into
mainfrom
fix/pr1-review

Conversation

@DaniAkash

Copy link
Copy Markdown
Owner

Summary

Fixes the two issues from the automated review on #1.

Changes

Scope Pages write permissions to the deploy job (.github/workflows/pages.yml)

  • The workflow previously granted pages: write and id-token: write at the top level, so the pull request build job, which installs dependencies and runs the Astro build on PR code, received write-capable credentials.
  • The workflow now defaults to contents: read. Only deploy gets pages: write and id-token: write, and that job never runs on pull requests. These are the two permissions actions/deploy-pages documents as required.

Make kit removal keep the user's own files (quick-start.mdx, faq.md)

  • Setup skips files that already exist, but "Remove the kit" ran an unconditional rm. That could delete a user's own AGENTS.md, rustfmt.toml or other config.
  • The removal script now:
    • deletes a file only if it is byte-identical to the kit's published version, and reports any it keeps
    • removes CLAUDE.md only when it is a symlink to an AGENTS.md the script just removed
    • suggests reverting the adoption commit first
    • lists the manual steps: the Cargo.toml lint tables, and a merged AGENTS.md section
  • The FAQ answer points to the same safe path.

Verification

  • Ran the removal script, extracted from the page, against the live /files/:
    • Kit-only project: all five files and the CLAUDE.md symlink are removed.
    • Project with its own rustfmt.toml and AGENTS.md: both are kept, along with the CLAUDE.md symlink pointing at them; the kit's other three files are removed.
  • astro check: 0 errors. All internal links are valid.
  • The workflow parses with top-level {"contents":"read"} and deploy-level {"pages":"write","id-token":"write"}. The deploy job can only run after merge, so confirm the first main deploy succeeds.

The build job runs dependency installs and the Astro build on pull request code, so it no longer receives pages: write or id-token: write. The workflow defaults to contents: read and only the deploy job, which never runs on pull requests, gets the Pages permissions.
The removal command deleted rustfmt.toml, AGENTS.md and the other files unconditionally, even though setup skips files that already exist. It now deletes a file only if it is byte-identical to the kit's published version. It removes CLAUDE.md only when it is a symlink to a removed AGENTS.md, and it tells users to remove a merged AGENTS.md section by hand. Reverting the adoption commit is suggested first. The FAQ answer points to the same safe path.
@DaniAkash
DaniAkash merged commit 5db892a into main Oct 23, 2026
5 checks passed
@DaniAkash
DaniAkash deleted the fix/pr1-review branch October 23, 2026 07:07
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.

1 participant