Skip to content

Fix PR preview deployment issues#708

Merged
adamkudrna merged 2 commits intomasterfrom
fix/pr-preview-css
Apr 1, 2026
Merged

Fix PR preview deployment issues#708
adamkudrna merged 2 commits intomasterfrom
fix/pr-preview-css

Conversation

@adamkudrna
Copy link
Copy Markdown
Member

@adamkudrna adamkudrna commented Mar 30, 2026

Fixes two issues in the PR preview deployment workflow introduced in #701.

--docoff-preview-css loads wrong CSS in previews

--docoff-preview-css was set to /docs/_assets/generated/react-ui.development.css — a root-relative path that always resolves against the domain root. In PR preview deployments served under a subdirectory (/react-ui/pr-preview/pr-{number}/), this caused the main site's CSS to be loaded instead of the preview's, leaving any styles not yet in a release unapplied.

A small setup script (setupDocoff.js) now derives the correct CSS URL from the co-located react-ui*.js bundle's src, and sets --docoff-preview-css via JS before docoff initialises. The hardcoded property in extra.css is commented out with a reference to react-ui-org/docoff#50, which tracks the upstream fix.

Cleanup step fails with 403

The Delete preview environment step in the cleanup job called DELETE /repos/.../environments/{name}, which requires admin-level repository access. The built-in GITHUB_TOKEN is a GitHub App installation token and cannot perform this operation regardless of the deployments: write permission granted to the workflow. The step has been removed — rossjrw/pr-preview-action with action: remove already handles all necessary cleanup on gh-pages.

The property was set to an absolute path `/docs/_assets/generated/react-ui.development.css`,
which resolves against the domain root and bypasses the PR preview subdirectory. A small setup
script now derives the URL from the co-located `react-ui*.js` bundle so that previews always
load the correct CSS for the deployed branch.
Deleting a GitHub environment requires admin-level repository access. The built-in
`GITHUB_TOKEN` is a GitHub App installation token and cannot perform this operation
regardless of the `deployments: write` permission granted to the workflow. The
`rossjrw/pr-preview-action` step already handles all necessary cleanup on `gh-pages`.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 30, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-04-01 09:20 UTC

@adamkudrna adamkudrna merged commit 905bd4f into master Apr 1, 2026
15 checks passed
@adamkudrna adamkudrna deleted the fix/pr-preview-css branch April 1, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant