Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix: Create API token on promote if needed #2332
This fixes error on promote without configured api tokens: POST https://api.github.com/repos/org/environment/pulls: 401 Bad credentials 
There is a bit of cleanup in related code.
Special notes for the reviewer(s)
I think any additional tests would need to be integration tests. But I haven't written any since it's difficult for me to do without access to the test environment.
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: ccojocar
The full list of commands accepted by this bot can be found here.
The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing