ci: tear down PR previews immediately on close#80
Conversation
Add the closed event to the preview workflow's trigger types. With web3-hosting-action v2.1.0 the action runs cleanup-only on a closed event (removes the preview without redeploying), so previews are torn down the moment a PR is closed or merged instead of on later PR activity.
|
Deployed on:
|
foxpatch-aleph
left a comment
There was a problem hiding this comment.
Small, correct one-line config change that adds closed to the pull_request event types so PR previews are torn down immediately instead of waiting for the next PR event. The comment block is rewritten accurately to explain the new strategy, and the dependency on web3-hosting-action@v2 (now pointing at v2.1.0) is called out in the description. No logic errors, no security issues.
.github/workflows/pr-preview.yml (line 25): Comment mentions the action runs in "cleanup-only mode" on closed events. This depends on web3-hosting-action@v2 actually resolving to v2.1.0+. Worth verifying the @v2 tag has been updated to point at that release before merging (the PR description says it has, but it's a soft dependency).
Adds the
closedevent to the PR-preview workflow'spull_requesttrigger so a preview is torn down the moment its PR is closed or merged, instead of waiting for the next pull request event.This relies on
web3-hosting-actionv2.1.0 (web3-hosting-action#4), which added a cleanup-only mode: on aclosedevent the action removes the preview and skips the deploy/comment steps, so it never recreates the preview it just removed. The@v2tag now points at that release.Change
The full
typeslist is intentional - listing only[closed]would drop theopened/synchronize/reopeneddefaults and stop previews deploying on push.Notes
closedpath is exercised when this PR (or a later one) is closed/merged; the deploy path is verified by the normal preview run on this PR.head.repo.full_name == github.repositoryguard); they never get a preview to clean up.