The API for environments, and environment protection rules is now available. The API enables you to automate scenarios like creating an environment or approving a deployment.
Learn more about the Environments API
Learn more about the GitHub Actions API