Refactor the script from top to bottom:
1. Switch to Python 3.
2. Add functionality for commenting only once (used for commenting messages
generated by the check-pr script).
3. Split the functionality clearly into two different actions: one for
pr-check information, and one for build errors.
4. Add additional env vars checks and error checks.