Auto release after closing the repository.

Avoid the manual step.