[mergebot] post comment on finishing (#79448)
This makes the bot comment to ping the user whenever the merge or revert finishes completing. Also does a bit of refactoring.
Addreses https://github.com/pytorch/test-infra/issues/392
Pull Request resolved: https://github.com/pytorch/pytorch/pull/79448
Approved by: https://github.com/seemethere