Fix PR preview cleanup by splitting deploy and remove steps#59
Fix PR preview cleanup by splitting deploy and remove steps#59
Conversation
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>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Fixes an issue where PR previews were not being cleaned up from the
gh-pagesbranch when pull requests were closed or merged. Thepr-preview-actionwas failing to clean up onclosedevents because the build step is skipped and thepublicfolder 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