8000 Add support for GitHub Environments for Pro/Teams pricing plans by AnitaErnszt · Pull Request #2611 · google/go-github · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add support for GitHub Environments for Pro/Teams pricing plans #2611

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jan 4, 2023

Conversation

AnitaErnszt
Copy link
Contributor

The PR fixes the issue reported on #2602

In June GitHub made the environments and environment protection rules generally available, however, the wait_timer and reviewers remain limited to enterprise.

Code was written to send wait_timer and reviewers with default values if no value is present, so existing settings can be cleared.
Due to this, the code was returning 422 when called to create environments for Pro/Team private repos, as these parameters are only supported for enterprise or public repos.

PR intends to handle the error with a retry when the following conditions are met:

  • error code is 422
  • wait_timer is the default value (0)
  • reviewers is the default value ([])

When retrying the call, a new object is sent, which only contains the parameters that are accepted for Pro/Teams private repos.