Skip to content

chore: make test environment cleanup manual-only#697

Merged
rajbos merged 1 commit intomainfrom
rajbos/keep-test-env-after-pr
Apr 29, 2026
Merged

chore: make test environment cleanup manual-only#697
rajbos merged 1 commit intomainfrom
rajbos/keep-test-env-after-pr

Conversation

@rajbos
Copy link
Copy Markdown
Owner

@rajbos rajbos commented Apr 29, 2026

Summary

Test environments were being automatically destroyed whenever a branch was deleted (i.e. after a PR was merged with auto-delete enabled). This made it impossible to use the test environment for post-merge validation.

Changes

  • Changed the sharing-server-cleanup.yml workflow trigger from on: delete to on: workflow_dispatch
  • Added a required branch input so the operator can specify which branch's environment to destroy
  • Added a guard to prevent accidental destruction of main / production
  • Updated all github.event.ref references to github.event.inputs.branch

Behaviour after this change

  • Test environments persist after a PR is merged and the branch is deleted ✅
  • Cleanup is still possible: go to Actions → Cleanup Sharing Server (manual) and enter the branch name to destroy that environment on demand

Stop auto-deleting test environments when branches are deleted.
The cleanup workflow now runs only on workflow_dispatch, requiring
the operator to supply the branch name explicitly. This lets test
environments persist after a PR is merged so they can be used for
further testing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rajbos rajbos enabled auto-merge April 29, 2026 12:21
@rajbos rajbos merged commit 43f43c2 into main Apr 29, 2026
19 checks passed
@rajbos rajbos deleted the rajbos/keep-test-env-after-pr branch April 29, 2026 12:22
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