Skip to content

Fix PR preview cleanup by splitting deploy and remove steps#59

Merged
e-minguez merged 1 commit intomainfrom
fix-pr-preview-cleanup-6697848251699145918
Mar 1, 2026
Merged

Fix PR preview cleanup by splitting deploy and remove steps#59
e-minguez merged 1 commit intomainfrom
fix-pr-preview-cleanup-6697848251699145918

Conversation

@e-minguez
Copy link
Copy Markdown
Owner

Fixes an issue where PR previews were not being cleaned up from the gh-pages branch when pull requests were closed or merged. The pr-preview-action was failing to clean up on closed events because the build step is skipped and the public folder wasn't present. This is fixed by separating the step into explicit deploy and remove actions, and bypassing the missing directory error.


PR created automatically by Jules for task 6697848251699145918 started by @e-minguez

The original configuration relied on the implicit "auto" action of
rossjrw/pr-preview-action to deploy on open/update and remove on close.
However, because the `Build` step is skipped when a PR is closed
(`if: github.event.action != 'closed'`), the `public` directory is never
created on closed events.

As a result, when the unified preview step ran on a PR close, the action
failed because it couldn't find the `source-dir: public` directory, which
left the preview orphaned on the `gh-pages` branch.

This commit explicitly splits the preview step into a `Deploy PR Preview`
step and a `Remove PR Preview` step. The removal step sets `source-dir: .`
to avoid the missing `public` directory issue and ensures that previews
are properly deleted from the `gh-pages` branch when the PR is closed.

Co-authored-by: e-minguez <346758+e-minguez@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 1, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://e-minguez.github.io/underkube/pr-preview/pr-59/

Built to branch gh-pages at 2026-03-01 13:21 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@e-minguez e-minguez merged commit b362998 into main Mar 1, 2026
1 check passed
@e-minguez e-minguez deleted the fix-pr-preview-cleanup-6697848251699145918 branch March 1, 2026 14:10
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