Repository navigation
fix(website): scope Pages permissions and make kit removal non-destructive - #3
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the two issues from the automated review on #1.
Changes
Scope Pages write permissions to the deploy job (
.github/workflows/pages.yml)pages: writeandid-token: writeat the top level, so the pull request build job, which installs dependencies and runs the Astro build on PR code, received write-capable credentials.contents: read. Onlydeploygetspages: writeandid-token: write, and that job never runs on pull requests. These are the two permissionsactions/deploy-pagesdocuments as required.Make kit removal keep the user's own files (
quick-start.mdx,faq.md)rm. That could delete a user's ownAGENTS.md,rustfmt.tomlor other config.CLAUDE.mdonly when it is a symlink to anAGENTS.mdthe script just removedCargo.tomllint tables, and a mergedAGENTS.mdsectionVerification
/files/:CLAUDE.mdsymlink are removed.rustfmt.tomlandAGENTS.md: both are kept, along with theCLAUDE.mdsymlink pointing at them; the kit's other three files are removed.astro check: 0 errors. All internal links are valid.{"contents":"read"}and deploy-level{"pages":"write","id-token":"write"}. The deploy job can only run after merge, so confirm the firstmaindeploy succeeds.