You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### TL;DR
Added automatic cleanup of Rivet namespaces when pull requests are closed.
### What changed?
- Added support for the `closed` pull request event type in the GitHub workflow
- Implemented a new cleanup flow that archives Rivet namespaces when PRs are closed
- Added logic to read GitHub event payload to determine PR context and action type
- Updated the README to document the new cleanup functionality
- Improved error handling in the Rivet Cloud API fetch function
- Added helper functions to extract repository and project information
### How to test?
1. Close a pull request that has a Rivet preview namespace
2. Verify that the GitHub action runs and archives the corresponding namespace
3. Check that the PR comment is updated to show the namespace has been archived
### Why make this change?
This change helps keep Rivet projects tidy by automatically cleaning up preview namespaces when they're no longer needed. Without this automation, unused namespaces would accumulate over time as PRs are closed, potentially causing resource waste and namespace clutter.
Copy file name to clipboardExpand all lines: README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ Creates Rivet namespaces for preview deployments.
34
34
35
35
on:
36
36
pull_request:
37
-
types: [opened, synchronize, reopened]
37
+
types: [opened, synchronize, reopened, closed]
38
38
push:
39
39
branches: [main]
40
40
@@ -67,3 +67,5 @@ When a PR is opened or updated:
67
67
This redeploy step is necessary because Vercel starts building immediately when a commit is pushed, before the action has a chance to set the required environment variables. The action automatically handles this by triggering a fresh deployment after configuration is complete.
68
68
69
69
Deployment protection is automatically bypassed by generating a token via the Vercel API.
70
+
71
+
When a PR is closed, the action archives the corresponding Rivet namespace to keep your project tidy.
0 commit comments